save point
This commit is contained in:
parent
4c8b2b9c3b
commit
5b83c89d4a
9 changed files with 128 additions and 41 deletions
33
modules/filen.bash
Normal file
33
modules/filen.bash
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Filen module for lactozora framework
|
||||
# Requires filen-cli to be installed and authenticated
|
||||
|
||||
filen_upload() {
|
||||
local file_path="$1"
|
||||
local remote_path="$2"
|
||||
|
||||
if [[ ! -f "$file_path" ]]; then
|
||||
echo "Error: File $file_path does not exist" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! command -v filen &> /dev/null; then
|
||||
echo "Error: filen-cli is not installed" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
filen upload "$file_path" "$remote_path"
|
||||
}
|
||||
|
||||
filen_download() {
|
||||
local remote_path="$1"
|
||||
local local_path="$2"
|
||||
|
||||
if ! command -v filen &> /dev/null; then
|
||||
echo "Error: filen-cli is not installed" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
filen download "$remote_path" "$local_path"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue