diff --git a/scripts/dev-build.sh b/scripts/dev-build.sh index c2c0e0d..fcb17a1 100644 --- a/scripts/dev-build.sh +++ b/scripts/dev-build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -dotnet build src/navigatio --no-restore && scripts/setup.sh src/navigatio/bin/debug/net6.0/ +dotnet build src/Navigatio --no-restore && scripts/setup.sh src/Navigatio/bin/debug/net6.0/ diff --git a/scripts/navigatio-completions.sh b/scripts/navigatio-completions.sh index 253a932..865ce32 100755 --- a/scripts/navigatio-completions.sh +++ b/scripts/navigatio-completions.sh @@ -12,3 +12,4 @@ _extract_keys_from_json() { } complete -F _navigatio_completions nav +complete -F _navigatio_completions n diff --git a/scripts/release.sh b/scripts/release.sh old mode 100644 new mode 100755 index 6369ebb..e8fb37b --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,14 +1,15 @@ #!/usr/bin/env bash -PROJECT_DIR=src/navigatio +PROJECT_DIR=src/Navigatio BASE_DIR=${PROJECT_DIR}/bin/Release function release_for_os() { - rm -rf ${BASE_DIR}/$1 && \ + rm -rf ${BASE_DIR}/$1 && + dotnet publish $PROJECT_DIR --configuration Release --output ${BASE_DIR}/$1 --runtime $1 --self-contained true && + (cd "${BASE_DIR}/$1/" && zip "$1.zip" * && cd - && cp "${BASE_DIR}/$1/$1.zip" .) - dotnet publish $PROJECT_DIR --configuration Release --output ${BASE_DIR}/$1 --runtime $1 --self-contained true && \ - - powershell Compress-Archive -Path "'${BASE_DIR}/$1/*'" -DestinationPath "$1.zip" -Force + # This was used to create a zip archive on windows: + # powershell Compress-Archive -Path "'${BASE_DIR}/$1/*'" -DestinationPath "$1.zip" -Force } release_for_os win-x86 diff --git a/scripts/setup.sh b/scripts/setup.sh index ebeeedb..e68922f 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -8,6 +8,10 @@ function create_dir() { cp -r ${EXE_PATH}. $ROOT } +function setup_autocompletion() { + sudo cp ${EXE_PATH}navigatio-completions.sh /etc/bash_completion.d/ +} + function sudo_create_dir() { sudo -E bash -c "$(declare -f create_dir); create_dir" } @@ -34,6 +38,7 @@ unamestr=$(uname) if [[ "$unamestr" == 'Linux' ]]; then sudo_create_dir set_permissions + setup_autocompletion else create_dir fi diff --git a/src/Navigatio/Navigatio.csproj b/src/Navigatio/Navigatio.csproj index 87fe4e7..1140b61 100644 --- a/src/Navigatio/Navigatio.csproj +++ b/src/Navigatio/Navigatio.csproj @@ -15,6 +15,7 @@ +