mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
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
This commit is contained in:
13
bootstrap.sh
13
bootstrap.sh
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
QUIET="n"
|
QUIET="n"
|
||||||
CREATE_LINKS="n"
|
CREATE_LINKS="y"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
if [ "$1" != "" ]; then
|
if [ "$1" != "" ]; then
|
||||||
@@ -21,7 +21,7 @@ usage() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Usage: $0 [-q|--quiet] [-l|--create-links]"
|
echo "Usage: $0 [-q|--quiet] [-l|--create-links]"
|
||||||
echo " -q, --quiet No screen outputs"
|
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 ""
|
||||||
echo "Example: $0 -q --create-links"
|
echo "Example: $0 -q --create-links"
|
||||||
@@ -32,9 +32,6 @@ place_dotfile_at_target_location() {
|
|||||||
file_target_location="$2"
|
file_target_location="$2"
|
||||||
TS="$3"
|
TS="$3"
|
||||||
|
|
||||||
# echo "${source_file_location}"
|
|
||||||
# echo "${file_target_location}"
|
|
||||||
|
|
||||||
# To avoid over writing existing dot file, we rename them
|
# To avoid over writing existing dot file, we rename them
|
||||||
# Appending the timestamp to file name
|
# Appending the timestamp to file name
|
||||||
if [ -f "$file_target_location" ] || [ -L "$file_target_location" ]; then
|
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}"
|
mv "$file_target_location" "${file_target_location}_${TS}" && [ "$QUIET" = "n" ] && echo "Existing setting renamed to ${file_target_location}_${TS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
target_directory
|
|
||||||
target_directory=$(dirname "$file_target_location")
|
target_directory=$(dirname "$file_target_location")
|
||||||
if [ ! -d "$target_directory" ]; then
|
if [ ! -d "$target_directory" ]; then
|
||||||
mkdir -p "$target_directory" && [ "$QUIET" = "n" ] && echo "Directory ${target_directory} created"
|
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
|
if [ "$CREATE_LINKS" = "y" ]; then
|
||||||
# echo "ln -s ${source_file_location} ${target_directory}"
|
# 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
|
else
|
||||||
# echo "cp ${source_file_location} ${target_directory}"
|
# echo "cp ${source_file_location} ${target_directory}"
|
||||||
cp "$source_file_location" "$target_directory" && [ "$QUIET" = "n" ] && echo "Copied ${file_target_location}"
|
cp "$source_file_location" "$target_directory" && [ "$QUIET" = "n" ] && echo "Copied ${file_target_location}"
|
||||||
@@ -83,6 +79,7 @@ main() {
|
|||||||
|
|
||||||
case $(uname -a) in
|
case $(uname -a) in
|
||||||
Linux*)
|
Linux*)
|
||||||
|
# TODO: Make it less KDE-Neon specific and more towards general Linux
|
||||||
OS="kde-neon"
|
OS="kde-neon"
|
||||||
|
|
||||||
[ "$XDG_CURRENT_DESKTOP" = "KDE" ] && OS="kde-neon"
|
[ "$XDG_CURRENT_DESKTOP" = "KDE" ] && OS="kde-neon"
|
||||||
@@ -109,7 +106,7 @@ main() {
|
|||||||
|
|
||||||
# Copy platform specific files to $HOME directory ("~")
|
# Copy platform specific files to $HOME directory ("~")
|
||||||
find "./${OS}" -type f -not -path '*.DS_Store' -not -path '*.directory' | while read -r file; do
|
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#.}"
|
source_file_location="${PWD}${file#.}"
|
||||||
place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS"
|
place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ return {
|
|||||||
-- https://github.com/joe-re/sql-language-server?tab=readme-ov-file#configuration
|
-- https://github.com/joe-re/sql-language-server?tab=readme-ov-file#configuration
|
||||||
sqlls = {},
|
sqlls = {},
|
||||||
marksman = {},
|
marksman = {},
|
||||||
awk_ls = {},
|
|
||||||
cssls = {},
|
cssls = {},
|
||||||
dockerls = {},
|
dockerls = {},
|
||||||
docker_compose_language_service = {},
|
docker_compose_language_service = {},
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export ADB_VENDOR_KEYS="$XDG_CONFIG_HOME/android"
|
|||||||
|
|
||||||
# Setup Python
|
# Setup Python
|
||||||
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
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 -)"
|
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+
|
export PYTHON_HISTORY="$XDG_STATE_HOME/shell/python_history" # will be picked up by Python 3.13+
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user