From b146f518af68cabe3735b44050813b80e4f6e08d Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 6 Jun 2024 05:50:11 +0000 Subject: [PATCH 1/2] feat: add save_file.sh --- tools/save_file.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tools/save_file.sh diff --git a/tools/save_file.sh b/tools/save_file.sh new file mode 100755 index 0000000..e0f26bd --- /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 name 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" "$@")" From 60f4ac080aa28731414135b31186f6448b014cdd Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 6 Jun 2024 05:50:44 +0000 Subject: [PATCH 2/2] update --- tools/save_file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/save_file.sh b/tools/save_file.sh index e0f26bd..8d4d43c 100755 --- a/tools/save_file.sh +++ b/tools/save_file.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -# @describe Saves the contents to a file called `file_name` and returns the file name if successful. +# @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.