next #1
3 changed files with 28 additions and 8 deletions
7
skip_steps.sh
Normal file
7
skip_steps.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir .dotfiles &>/dev/null
|
||||||
|
|
||||||
|
for item in ${@:-update install_package_list run_system_scripts run_user_scripts link_home overlay}; do
|
||||||
|
echo "executed_step:$item" >> .dotfiles/pending_sync
|
||||||
|
done
|
27
sync.sh
27
sync.sh
|
@ -99,21 +99,34 @@ __step_link_home() {
|
||||||
for item in $(find ./home -type f); do
|
for item in $(find ./home -type f); do
|
||||||
path=$(echo $item | sed "s/\.\/home//")
|
path=$(echo $item | sed "s/\.\/home//")
|
||||||
[ -z "$path" ] && continue
|
[ -z "$path" ] && continue
|
||||||
|
grep -q "$path" $trackingfile &> /dev/null && continue
|
||||||
path="$HOME$path"
|
path="$HOME$path"
|
||||||
mkdir -p $(dirname $path) &> /dev/null
|
mkdir -p $(dirname $path) &> /dev/null
|
||||||
ln $item $path && echo "$path" >> $trackingfile
|
ln $item $path && echo "$path" >> $trackingfile
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step() {
|
||||||
|
if ! grep -q "executed_step:$1" .dotfiles/pending_sync &> /dev/null; then
|
||||||
|
$(printf "__step_%s" "$1")
|
||||||
|
echo "executed_step:$1" >> .dotfiles/pending_sync
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
mkdir -p .dotfiles &> /dev/null
|
mkdir -p .dotfiles &> /dev/null
|
||||||
|
touch .dotfiles/pending_sync
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
$(printf "__step_%s" "$1")
|
step $1
|
||||||
else
|
else
|
||||||
__step_update
|
echo "started_sync:$(date)" >> .dotfiles/log
|
||||||
__step_install_package_list
|
step update
|
||||||
__step_run_system_scripts
|
step install_package_list
|
||||||
__step_run_user_scripts
|
step run_system_scripts
|
||||||
__step_link_home
|
step run_user_scripts
|
||||||
__step_overlay
|
step link_home
|
||||||
|
step overlay
|
||||||
|
echo "finished_sync:$(date)" >> .dotfiles/log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unlink .dotfiles/pending_sync
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
for linkfile in $@; do
|
for linkfile in ${@:-$(find .dotfiles -type f -name *-links)}; do
|
||||||
echo "# processing linkfile $linkfile..."
|
echo "# processing linkfile $linkfile..."
|
||||||
for link in $(cat $linkfile); do
|
for link in $(cat $linkfile); do
|
||||||
echo "# unlinking $link..."
|
echo "# unlinking $link..."
|
||||||
|
|
Loading…
Reference in a new issue