Skip to content

Commit

Permalink
shellcheck, readme cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBrain committed Sep 23, 2024
1 parent 7d8026e commit 5e18181
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Options:
* **Renaming**: If you need to rename a file or directory with the nosync extension, you'll need to recreate the symlink. Although Finder can still locate the renamed file or directory through the old symlink, the symlink itself will continue pointing to the original location, which isn't the case in Terminal.
* My recommendation is to delete the symlink, remove the nosync extension, and then rerun the command.
* **Git**: If the file or folder is in a git repository and the .nosync file or extension is added to `.gitignore`, the symlink will still be tracked.
* **Undo**: If the symlink name differs from the .nosync name, the symlink will be left unchanged. The undo process does not involve or modify the `.gitignore` file. ~~There’s no dedicated undo function. To reverse an action, simply delete the symlink and remove the nosync extension from the file or folder.~~
* **Undo**: If the symlink name differs from the .nosync name, the symlink will be left unchanged. The undo process does not involve or modify the `.gitignore` file.
* **Files**: Files with the nosync extension wont open with their associated application anymore. Images wont be opened in preview, docs won't start Word or Pages.
* Avoid using nosync on files. Use it on directories whenever possible.

Expand Down
4 changes: 2 additions & 2 deletions nosync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EOF
log () {
if [ "$1" == "error" ]; then
shift
echo "Error: $@" >&2
echo "Error:" "$@" >&2
elif [ "$verbose" -eq 1 ]; then
echo "$@"
fi
Expand Down Expand Up @@ -101,7 +101,7 @@ handle_gitignore () {

case "$answer" in
[yY][eE][sS]|[yY])
if [ -f "$gitignore_path" ] && ! grep -qx '*.nosync' "$gitignore_path"; then
if [ -f "$gitignore_path" ] && ! grep -qx '\*.nosync' "$gitignore_path"; then
echo "*.nosync" >> "$gitignore_path"
log "Added '*.nosync' to $gitignore_path."
elif [ ! -f "$gitignore_path" ]; then
Expand Down

0 comments on commit 5e18181

Please sign in to comment.