33 lines
742 B
Bash
33 lines
742 B
Bash
#!/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"
|
|
}
|