Skip to content

Commit

Permalink
it installs, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
bcumming committed Mar 11, 2024
1 parent baa95b4 commit 6043968
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 49 deletions.
5 changes: 5 additions & 0 deletions activate
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

export UENV_ROOT=@@prefix@@
export UENV_CMD=@@impl@@
export UENV_IMG_CMD=@@image_impl@@
export UENV_VERSION=@@version@@
export UENV_PREFIX=@@prefix@@

Expand All @@ -23,6 +24,10 @@ function uenv {

if [ "$1" = "--version" ]; then
echo "@@version@@";
elif [ "$1" = "image" ]; then
# TODO: check for flags applied to uenv like -v --no-color and forward them
shift;
$UENV_IMG_CMD $@
elif [[ $# -eq 0 || "$1" = "--help" || "$1" = "-h" ]]; then
uenv_usage;
elif [[ " $* " =~ [[:space:]](-h|--help)[[:space:]] ]]; then
Expand Down
18 changes: 18 additions & 0 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,28 @@ $show cp "$script_path/uenv-impl" "$impl_path"
$show sed "s|@@version@@|$version|g" -i "$impl_path"
$show chmod 755 "$impl_path"

# install the uenv image tool
img_impl_path="$prefix/libexec/uenv-image"
echo "installing $img_impl_path"
$show cp "$script_path/uenv-image" "$img_impl_path"
$show chmod 755 "$img_impl_path"

lib_path="$prefix/libexec/uenv-lib"
echo "installing $lib_path"
$show install -v -m 755 -d "$lib_path"
$show install -v -m 644 -D -t "$lib_path" uenv-lib/datastore.py
$show install -v -m 644 -D -t "$lib_path" uenv-lib/flock.py
$show install -v -m 644 -D -t "$lib_path" uenv-lib/jfrog.py
$show install -v -m 644 -D -t "$lib_path" uenv-lib/oras.py
$show install -v -m 644 -D -t "$lib_path" uenv-lib/record.py
$show install -v -m 644 -D -t "$lib_path" uenv-lib/terminal.py
$show cp "$script_path/uenv-image" "$img_impl_path"

# Copy the initialisation script
echo "installing $init_path"
$show cp "$script_path/activate" "$init_path"
$show sed "s|@@impl@@|$impl_path|g" -i "$init_path"
$show sed "s|@@image_impl@@|$img_impl_path|g" -i "$init_path"
$show sed "s|@@prefix@@|$prefix|g" -i "$init_path"
$show sed "s|@@version@@|$version|g" -i "$init_path"
$show chmod 644 "$init_path"
Expand Down
Loading

0 comments on commit 6043968

Please sign in to comment.