Skip to content

Commit

Permalink
update file
Browse files Browse the repository at this point in the history
  • Loading branch information
pourmand1376 committed Aug 20, 2024
1 parent a0af7d6 commit ec7b824
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions obsidian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ function remove_files_from_git()
folder_name="$1"
cd "$DOWNLOAD_FOLDER/$folder_name" || { echo "Failure while changing directory into $DOWNLOAD_FOLDER/$folder_name"; exit 1; }

FILES="$HOME_PATH/$folder_name/.obsidian/workspace
$HOME_PATH/$folder_name/.obsidian/workspace.json
$HOME_PATH/$folder_name/.obsidian/workspace-mobile.json"
FILES=".obsidian/workspace
.obsidian/workspace.json
.obsidian/workspace-mobile.json"

for file in $FILES; do
if [ -f "$file" ]; then
cd "$HOME_PATH/$folder_name" || { echo "Failure while changing directory into $HOME_PATH/$folder_name"; exit 1; }
git rm --cached "$file"
git rm -f --cached "$DOWNLOAD_FOLDER/$folder_name/$file"
echo "removed $file from git"
fi
done
cd "$HOME_PATH/$folder_name" || { echo "Failure while changing directory into $HOME_PATH/$folder_name"; exit 1; }
if git status | grep "new file" ; then
if [[ `git status --porcelain` ]] ; then
git commit -am "Remove ignored files"
fi

Expand Down

0 comments on commit ec7b824

Please sign in to comment.