Remove hardcoded code
This commit is contained in:
parent
1abe59c18b
commit
95cf5b297c
|
@ -46,13 +46,9 @@ linkFile() {
|
|||
loopThroughFiles() {
|
||||
SADEDOT=$(pwd -P)
|
||||
DOTFILES="$SADEDOT/dotfiles"
|
||||
DOTFILES_CONFIG="$DOTFILES/.config"
|
||||
DOTFILES_LOCAL="$DOTFILES/.local"
|
||||
DOTFILES_ICONS="$DOTFILES/.icons"
|
||||
DOTFILES_SSH="$DOTFILES/.ssh"
|
||||
|
||||
local IFS=$'\n'
|
||||
for srcFile in $(find -H "$DOTFILES" -not -path '*.git*' -not -path '*.config*' -not -path '*.ssh*' -not -path '*.icons*' -not -path '*.local*' -not -path '*other*'); do
|
||||
for srcFile in $(find -H "$DOTFILES" -maxdepth 1 -type f); do
|
||||
if [ "$(basename "${srcFile}")" = "dotfiles" ]; then
|
||||
continue
|
||||
fi
|
||||
|
@ -62,7 +58,7 @@ loopThroughFiles() {
|
|||
fi
|
||||
done
|
||||
|
||||
for initialFolder in "$DOTFILES_CONFIG" "$DOTFILES_ICONS" "$DOTFILES_SSH" "$DOTFILES_LOCAL"; do
|
||||
for initialFolder in $(find -H "$DOTFILES" -maxdepth 1 -mindepth 1 -type d -not -path '*other*'); do
|
||||
for srcFile in $(find -H "$initialFolder"); do
|
||||
if [[ -d "$srcFile" ]]; then
|
||||
var=$(echo "$srcFile" | awk '{ sub(/.*dotfiles\//, ""); print }')
|
||||
|
@ -79,10 +75,8 @@ loopThroughFiles() {
|
|||
done
|
||||
done
|
||||
|
||||
DOTFILES_OTHER=$DOTFILES/other
|
||||
|
||||
if [ -d "$DOTFILES_OTHER" ]; then
|
||||
filesOutput=$(find -H "$DOTFILES_OTHER" | sed -n 2~1p | awk '{ sub(/.*dotfiles\/other\//, ""); print }')
|
||||
if [ -d "$DOTFILES/other" ]; then
|
||||
filesOutput=$(find -H "$DOTFILES/other" | sed -n 2~1p | awk '{ sub(/.*dotfiles\/other\//, ""); print }')
|
||||
files=""; for item in $filesOutput; do
|
||||
files="${files}$item\n"
|
||||
done
|
||||
|
@ -99,10 +93,11 @@ runDetachedScript() {
|
|||
source scripts/common.sh
|
||||
setDialogBox "$1"
|
||||
|
||||
DOTFILES_OTHER=$(pwd -P)/dotfiles/other
|
||||
SADEDOT=$(pwd -P)
|
||||
DOTFILES="$SADEDOT/dotfiles"
|
||||
|
||||
local IFS=$'\n'
|
||||
for srcFile in $(find -H "$DOTFILES_OTHER"); do
|
||||
for srcFile in $(find -H "$DOTFILES/other" -mindepth 1); do
|
||||
if [[ -d "$srcFile" ]]; then
|
||||
var=$(echo "$srcFile" | awk '{ sub(/.*dotfiles\/other\//, ""); print }')
|
||||
|
||||
|
|
Loading…
Reference in New Issue