Add dependencies
This commit is contained in:
47
deploy.sh
Normal file
47
deploy.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
source_dir="./config"
|
||||
target_config_dir="$HOME/.config"
|
||||
|
||||
nodejs_version="v22.21.0"
|
||||
|
||||
# Ensure fish/fisher setup + install plugins
|
||||
if fish -c "which fisher" >/dev/null 2>&1; then
|
||||
echo "fisher is installed"
|
||||
else
|
||||
echo "fisher not found. installing."
|
||||
# curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
|
||||
fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher"
|
||||
fi
|
||||
|
||||
for dir in "$source_dir"/*/; do
|
||||
if [ -d "$dir" ]; then # Check if it's a directory
|
||||
dir_name=$(basename "$dir")
|
||||
source=$source_dir"/"$dir_name
|
||||
target=$target_config_dir"/"$dir_name
|
||||
|
||||
echo "Source: " $source
|
||||
echo "Target: " $target
|
||||
# rm -rf $target
|
||||
|
||||
if [ "$(ls -A $source)" ]; then
|
||||
mkdir -p $target
|
||||
cp -rf "$source/"* "$target/"
|
||||
else
|
||||
echo "$source is empty"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
fish -c "fisher update"
|
||||
|
||||
|
||||
fish -c "set --universal nvm_default_version $nodejs_version"
|
||||
if fish -c "which node" >/dev/null 2>&1; then
|
||||
version=$(node --version)
|
||||
echo "node is installed: $version"
|
||||
else
|
||||
echo "nodejs not found. installing."
|
||||
fish -c "nvm install $nodejs_version"
|
||||
fish -c "nvm use $nodejs_version"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user