aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-06 15:15:39 +0800
committerGitHub <noreply@github.com>2024-06-06 15:15:39 +0800
commite810d566bebd548915a409580429c036e242c33f (patch)
treef6a0bf5afe0f72b18e8fb543443649d9dfc45c6a /tools
parent61440a09167269b05c431dc40789faa62c528f34 (diff)
downloadllm-functions-docker-e810d566bebd548915a409580429c036e242c33f.tar.gz
feat: add save_file.sh (#25)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/save_file.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/save_file.sh b/tools/save_file.sh
new file mode 100755
index 0000000..8d4d43c
--- /dev/null
+++ b/tools/save_file.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+set -e
+
+# @describe Saves the contents to a file called `file_name` and returns the file path if successful.
+# @option --file-name! The name of the file to save to.
+# @option --contents! The contents to save.
+
+main() {
+ base_dir="$LLM_FUNCTIONS_DIR/tmp/files"
+ output_file="$base_dir/$argc_file_name"
+ mkdir -p "$base_dir"
+ echo "$argc_contents" > "$output_file"
+ echo "$output_file"
+}
+
+eval "$(argc --argc-eval "$0" "$@")"