aboutsummaryrefslogtreecommitdiff
path: root/store/works/Crupest.SecretTool/build-secret.bash
diff options
context:
space:
mode:
Diffstat (limited to 'store/works/Crupest.SecretTool/build-secret.bash')
-rwxr-xr-xstore/works/Crupest.SecretTool/build-secret.bash41
1 files changed, 41 insertions, 0 deletions
diff --git a/store/works/Crupest.SecretTool/build-secret.bash b/store/works/Crupest.SecretTool/build-secret.bash
new file mode 100755
index 0000000..8878049
--- /dev/null
+++ b/store/works/Crupest.SecretTool/build-secret.bash
@@ -0,0 +1,41 @@
+#! /usr/bin/env bash
+
+set -e
+
+function print_argument_error_message_and_exit() {
+ argument_error_message="You must specify exactly one argument, the build target (win-x64 | linux-x64 | osx-x64)."
+ echo "$argument_error_message"
+ exit 1
+}
+
+
+
+if [[ $# != 1 ]]; then
+ print_argument_error_message_and_exit
+fi
+
+case "$1" in
+ win-x64 | linux-x64 | osx-x64)
+ echo "Build target: $1"
+ ;;
+ *)
+ print_argument_error_message_and_exit
+ ;;
+esac
+
+secret_dir=$(realpath "$(dirname "$0")")
+
+echo "Secret dir: ${secret_dir}"
+
+echo "Check dotnet..."
+dotnet --version
+
+echo "Enter \"secret\" dir..."
+pushd "$secret_dir"
+
+echo "Begin to build..."
+dotnet publish Crupest.SecretTool -c Release -o "$secret_dir/publish" --sc -r "$1"
+
+popd
+
+echo "Finish!"