Skip to content

Commit

Permalink
Simplified script.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Oct 23, 2024
1 parent 7836ff1 commit 905e0af
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions metacall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ def install
system "cmake", *args, ".."
system "cmake", "--build", ".", "--target", "install"

shebang = "#!/usr/bin/env bash\n"
# debug = "set -euxo pipefail\n"

metacall_extra = [
metacall_sh = [
"#!/usr/bin/env bash\n",
"SCRIPT_DIR=$(cd -- \"$(dirname -- \"${BASH_SOURCE[0]}\")\" &> /dev/null && pwd)\n",
"PARENT=$(dirname \"${SCRIPT_DIR}\")\n",
"if [ -f \"${PARENT}/metacallcli\" ]; then\n",
Expand All @@ -154,13 +152,12 @@ def install
"export DETOUR_LIBRARY_PATH=\"${PREFIX}/lib\"\n",
"export PORT_LIBRARY_PATH=\"${PREFIX}/lib\"\n",
"export CONFIGURATION_PATH=\"${PREFIX}/configurations/global.json\"\n",
"export LOADER_SCRIPT_PATH=\"\${LOADER_SCRIPT_PATH:-\`pwd\`}\"\n",
"${PREFIX}/metacallcli $@\n"
]
cmds = [shebang, *metacall_extra]
cmds.append("export LOADER_SCRIPT_PATH=\"\${LOADER_SCRIPT_PATH:-\`pwd\`}\"\n")
cmds.append("${PREFIX}/metacallcli $@\n")

File.open("metacall.sh", "w") do |f|
f.write(*cmds)
f.write(*metacall_sh)
end

chmod("u+x", "metacall.sh")
Expand Down

0 comments on commit 905e0af

Please sign in to comment.