From 2463b0bc8d97e0211b15fe2e2b3a873ed825d39c Mon Sep 17 00:00:00 2001 From: Pratik Tripathy Date: Tue, 2 Jul 2024 15:30:09 +0530 Subject: [PATCH] fix: bootstrap.sh: make simlinks default action fix: bootstrap.sh: removed spurious values from code and from comments NeoVIM: Remove awk_ls from default Mason installs --- bootstrap.sh | 13 +++++-------- common/.config/nvim/lua/plugins/code-lsp.lua | 1 - common/.profile | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 9c92206..3c62b81 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -9,7 +9,7 @@ # defaults QUIET="n" -CREATE_LINKS="n" +CREATE_LINKS="y" usage() { if [ "$1" != "" ]; then @@ -21,7 +21,7 @@ usage() { echo "" echo "Usage: $0 [-q|--quiet] [-l|--create-links]" echo " -q, --quiet No screen outputs" - echo " -l, --create-links Creates soft-links to files in the current directory instead of copying them" + echo " -l, --create-links Applied by default. Creates soft-links to files in the current directory instead of copying them" echo "" echo "Example: $0 -q --create-links" @@ -32,9 +32,6 @@ place_dotfile_at_target_location() { file_target_location="$2" TS="$3" - # echo "${source_file_location}" - # echo "${file_target_location}" - # To avoid over writing existing dot file, we rename them # Appending the timestamp to file name if [ -f "$file_target_location" ] || [ -L "$file_target_location" ]; then @@ -42,7 +39,6 @@ place_dotfile_at_target_location() { mv "$file_target_location" "${file_target_location}_${TS}" && [ "$QUIET" = "n" ] && echo "Existing setting renamed to ${file_target_location}_${TS}" fi - target_directory target_directory=$(dirname "$file_target_location") if [ ! -d "$target_directory" ]; then mkdir -p "$target_directory" && [ "$QUIET" = "n" ] && echo "Directory ${target_directory} created" @@ -50,7 +46,7 @@ place_dotfile_at_target_location() { if [ "$CREATE_LINKS" = "y" ]; then # echo "ln -s ${source_file_location} ${target_directory}" - ln -s "$source_file_location" "$target_directory" && [ "$QUIET" = "n" ] && echo "Linked ${file_target_location}" + ln -sf "$source_file_location" "$target_directory" && [ "$QUIET" = "n" ] && echo "Linked ${file_target_location}" else # echo "cp ${source_file_location} ${target_directory}" cp "$source_file_location" "$target_directory" && [ "$QUIET" = "n" ] && echo "Copied ${file_target_location}" @@ -83,6 +79,7 @@ main() { case $(uname -a) in Linux*) + # TODO: Make it less KDE-Neon specific and more towards general Linux OS="kde-neon" [ "$XDG_CURRENT_DESKTOP" = "KDE" ] && OS="kde-neon" @@ -109,7 +106,7 @@ main() { # Copy platform specific files to $HOME directory ("~") find "./${OS}" -type f -not -path '*.DS_Store' -not -path '*.directory' | while read -r file; do - file_target_location="${HOME}${file#./${OS}}" + file_target_location="${HOME}${file#./"${OS}"}" source_file_location="${PWD}${file#.}" place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS" done diff --git a/common/.config/nvim/lua/plugins/code-lsp.lua b/common/.config/nvim/lua/plugins/code-lsp.lua index 8f20705..6bf25e6 100644 --- a/common/.config/nvim/lua/plugins/code-lsp.lua +++ b/common/.config/nvim/lua/plugins/code-lsp.lua @@ -125,7 +125,6 @@ return { -- https://github.com/joe-re/sql-language-server?tab=readme-ov-file#configuration sqlls = {}, marksman = {}, - awk_ls = {}, cssls = {}, dockerls = {}, docker_compose_language_service = {}, diff --git a/common/.profile b/common/.profile index 625de7f..bfc8546 100644 --- a/common/.profile +++ b/common/.profile @@ -67,7 +67,7 @@ export ADB_VENDOR_KEYS="$XDG_CONFIG_HOME/android" # Setup Python export PYENV_ROOT="$XDG_DATA_HOME/pyenv" -command -v pyenv >/dev/null && export PATH="$PATH:$PYENV_ROOT/bin" +command -v pyenv >/dev/null && export PATH="$PATH:$PYENV_ROOT/bin:$PYENV_ROOT/shims" command -v pyenv >/dev/null && eval "$(pyenv init -)" export PYTHON_HISTORY="$XDG_STATE_HOME/shell/python_history" # will be picked up by Python 3.13+