diff --git a/README.md b/README.md index e9760ad..5b0d8c8 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/nosync.sh b/nosync.sh index 7874ea9..93ed66b 100755 --- a/nosync.sh +++ b/nosync.sh @@ -26,7 +26,7 @@ EOF log () { if [ "$1" == "error" ]; then shift - echo "Error: $@" >&2 + echo "Error:" "$@" >&2 elif [ "$verbose" -eq 1 ]; then echo "$@" fi @@ -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