Skip to content

Commit

Permalink
add autocomplete to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
VladBrok committed Jun 5, 2023
1 parent 4b162df commit e63119e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/dev-build.sh
Original file line number Diff line number Diff line change
@@ -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/
1 change: 1 addition & 0 deletions scripts/navigatio-completions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ _extract_keys_from_json() {
}

complete -F _navigatio_completions nav
complete -F _navigatio_completions n
11 changes: 6 additions & 5 deletions scripts/release.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -34,6 +38,7 @@ unamestr=$(uname)
if [[ "$unamestr" == 'Linux' ]]; then
sudo_create_dir
set_permissions
setup_autocompletion
else
create_dir
fi
Expand Down
1 change: 1 addition & 0 deletions src/Navigatio/Navigatio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<None Include="../../settings.json" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../scripts/nav.sh" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../scripts/setup.sh" CopyToOutputDirectory="PreserveNewest" />
<None Include="../../scripts/navigatio-completions.sh" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>

0 comments on commit e63119e

Please sign in to comment.