Add runDetachedScript()
This commit is contained in:
parent
635bfcca7d
commit
1f66b9dc57
|
@ -85,18 +85,26 @@ loopThroughFiles() {
|
||||||
displayDialogBox --yesno "There are 'other' files, would you like to install them?\n\n$filesOutput" || return
|
displayDialogBox --yesno "There are 'other' files, would you like to install them?\n\n$filesOutput" || return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo bash -c "$(declare -f runDetachedScript); $(declare -f linkFile); "runDetachedScript""
|
||||||
|
}
|
||||||
|
|
||||||
|
runDetachedScript() {
|
||||||
|
source scripts/common.sh
|
||||||
|
|
||||||
|
DOTFILES_OTHER=$(pwd -P)/dotfiles/other
|
||||||
|
|
||||||
for srcFile in $(find -H "$DOTFILES_OTHER"); do
|
for srcFile in $(find -H "$DOTFILES_OTHER"); do
|
||||||
if [[ -d "$srcFile" ]]; then
|
if [[ -d "$srcFile" ]]; then
|
||||||
var=$(echo "$srcFile" | awk '{ sub(/.*CocoRice\/dotfiles\/other\//, ""); print }')
|
var=$(echo "$srcFile" | awk '{ sub(/.*CocoRice\/dotfiles\/other\//, ""); print }')
|
||||||
|
|
||||||
if [[ ! -d "/$var" ]]; then
|
if [[ ! -d "/$var" ]]; then
|
||||||
sudo mkdir -p "/$var"
|
mkdir -p "/$var"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$srcFile" ]]; then
|
if [[ -f "$srcFile" ]]; then
|
||||||
var=$(echo "$srcFile" | awk '{ sub(/.*CocoRice\/dotfiles\/other\//, ""); print }')
|
var=$(echo "$srcFile" | awk '{ sub(/.*CocoRice\/dotfiles\/other\//, ""); print }')
|
||||||
sudo bash -c "$(declare -f linkFile); "linkFile" "$srcFile" "/$var""
|
linkFile "$srcFile" "/$var"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue