feature/deploy-system #2

Merged
ljp merged 15 commits from feature/deploy-system into main 2025-09-11 17:56:21 +02:00
Showing only changes of commit 06647a1bf1 - Show all commits
+40 -12
View File
@@ -101,15 +101,16 @@ deploy_script() {
return 0
fi
# Deployment ausführen
scp "$original_script" "$ssh_target:$script_name"
ssh "$ssh_target" "chmod +x $script_name && mkdir -p ~/bin && ln -sf ~/$script_name ~/bin/$script_name"
# Deployment ausführen - ordentlich in ~/scripts/
ssh "$ssh_target" "mkdir -p ~/scripts ~/bin"
scp "$original_script" "$ssh_target:scripts/$script_name"
ssh "$ssh_target" "chmod +x ~/scripts/$script_name && ln -sf ~/scripts/$script_name ~/bin/$script_name"
# Lib-Dependencies falls vorhanden
if [[ -d "$script_dir/lib" ]]; then
echo " Deploying lib dependencies..."
scp -r "$script_dir/lib" "$ssh_target:lib_$script_name"
ssh "$ssh_target" "sed -i 's|\$SCRIPT_DIR/lib/|~/lib_$script_name/|g' $script_name"
scp -r "$script_dir/lib" "$ssh_target:scripts/lib_$script_name"
ssh "$ssh_target" "sed -i 's|\$SCRIPT_DIR/lib/|~/scripts/lib_$script_name/|g' ~/scripts/$script_name"
fi
echo " ✓ $script_name deployed successfully"
@@ -127,25 +128,52 @@ deploy_bashrc() {
return 0
fi
# Erstelle einfache .bashrc mit PATH-Setup
# Erstelle modulare .bashrc + config files
ssh "$ssh_target" 'cat > .bashrc << "EOF"
# .bashrc - Einfache Bash-Konfiguration für easyname Support
# .bashrc - Optimierte Bash-Konfiguration für easyname Support
# History
##### History #####
HISTCONTROL=ignoredups:erasedups
HISTSIZE=50000
HISTFILESIZE=100000
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
shopt -s histappend
shopt -s cmdhist
# PATH Setup
[[ -d "$HOME/bin" && ":$PATH:" != *":$HOME/bin:"* ]] && PATH="$HOME/bin:$PATH"
##### Prompt #####
if [[ "$TERM" != "dumb" ]]; then
PS1="\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\\$ "
fi
# Prompt
[[ "$TERM" != "dumb" ]] && PS1="\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\\$ "
##### Modular configs #####
[[ -f ~/.bash_aliases ]] && source ~/.bash_aliases
[[ -f ~/.bash_env ]] && source ~/.bash_env
[[ -f ~/.bash_paths ]] && source ~/.bash_paths
##### Standard settings #####
if [[ -f /etc/bash_completion ]]; then
source /etc/bash_completion
fi
if [[ -x /usr/bin/dircolors ]]; then
eval "$(dircolors -b)"
fi
# Built with the help of Claude Code
EOF'
# Erstelle modulare Config-Files mit PATH-Check
ssh "$ssh_target" 'echo "# Add your custom aliases here" > .bash_aliases'
ssh "$ssh_target" 'echo "# Add your PATH extensions here" > .bash_paths'
# Prüfe ob ~/bin bereits in PATH ist, wenn nicht -> zu .bash_env hinzufügen
ssh "$ssh_target" 'if [[ ":$PATH:" != *":$HOME/bin:"* ]]; then
echo "# Add ~/bin to PATH for deployed scripts" > .bash_env
echo "export PATH=\"\$HOME/bin:\$PATH\"" >> .bash_env
else
echo "# Add your environment variables here" > .bash_env
fi'
echo " ✓ bashrc deployed successfully"
}