Basename able to deal with .git repos

This commit is contained in:
~erin 2023-04-02 12:36:09 -04:00
parent 99a69219f9
commit 3305d85492
Signed by: erin
GPG Key ID: 9A8E308CEFA37A47
1 changed files with 7 additions and 5 deletions

View File

@ -41,6 +41,8 @@ function build
return 1
end
set -x BASENAME $(basename $REPOSITORY | sed 's/.git//g')
switch $_flag_compiler
case 'cargo'
set -x COMPILER $_flag_compiler
@ -94,9 +96,9 @@ function build
end
if $RELEASE
set -x BINARY_PATH '~/src/'(basename $REPOSITORY)'/target/release/'(basename $REPOSITORY)
set -x BINARY_PATH '~/src/'$BASENAME'/target/release/'$BASENAME
else
set -x BINARY_PATH '~/src/'(basename $REPOSITORY)'/target/debug/'(basename $REPOSITORY)
set -x BINARY_PATH '~/src/'$BASENAME'/target/debug/'$BASENAME
end
# TODO: Add colours
@ -126,6 +128,7 @@ function build
return 1
end
if set -ql FEATURES
if $RELEASE
set -x BUILD_COMMAND $COMPILER $SUBCOMMAND '--release --features' $FEATURES
@ -139,7 +142,7 @@ function build
set_color white
echo -e '\n'
set -xl COMMANDS 'cd ~/src; git clone' $REPOSITORY '; cd ' (basename $REPOSITORY) '; ' $BUILD_COMMAND
set -xl COMMANDS 'cd ~/src; git clone' $REPOSITORY '; cd ' $BASENAME '; ' $BUILD_COMMAND
ssh -t $HOST $COMMANDS
else
if $RELEASE
@ -154,7 +157,7 @@ function build
set_color white
echo -e '\n'
set -xl COMMANDS 'cd ~/src; git clone' $REPOSITORY '; cd ' (basename $REPOSITORY) '; ' $BUILD_COMMAND
set -xl COMMANDS 'cd ~/src; git clone' $REPOSITORY '; cd ' $BASENAME '; ' $BUILD_COMMAND
ssh -t $HOST $COMMANDS
end
@ -164,7 +167,6 @@ function build
echo $BINARY_PATH
set_color white
echo $_flag_destination
if set -ql _flag_destination
scp $HOST:$BINARY_PATH $_flag_destination
else