Skip to content

Commit

Permalink
Add a top-level wrapper for resalloc-ibm-cloud-vm script
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Jan 11, 2025
1 parent 1224dc5 commit 54202f5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .git-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/bash

# Execute scripts directly from git.

base=$(basename "$0")
base=${base//resalloc-/}
base=${base//-/_}
file="resalloc_ibm_cloud/$base.py"

die() { echo >&2 "fatal: $*"; exit 1; }

cd "$(dirname "$(readlink -f "$0")")" || exit 1

test -e "$file" || die "$file not found"

echo >&2 "WARNING: You run the command from Git repo, debugging only (no support)!"
exec python3 -c "from resalloc_ibm_cloud.$base import main; import sys; sys.argv[0] = '$0'; main()" "$@"
1 change: 1 addition & 0 deletions resalloc-ibm-cloud-vm

0 comments on commit 54202f5

Please sign in to comment.