Skip to content

Instantly share code, notes, and snippets.

@ogra
Created December 15, 2021 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ogra/64dc3688bba35d7b255f800f6c67e062 to your computer and use it in GitHub Desktop.
Save ogra/64dc3688bba35d7b255f800f6c67e062 to your computer and use it in GitHub Desktop.
Exclude node_modules directory from syncing on Dropbox. (macOS)
#!/bin/bash
EXCLUDEDIR=node_modules
EXLUDEDIR_FULL="`pwd`/$EXCLUDEDIR"
if [[ -d "$EXCLUDEDIR" ]]
then
echo "$EXCLUDEDIR exists on current directory."
else
echo "$EXCLUDEDIR deos not exist on current directory."
echo "Making $EXCLUDEDIR directory on current directory."
mkdir $EXCLUDEDIR
fi
xattr -p com.dropbox.ignored $EXLUDEDIR_FULL
if [ $? = 1 ]
then
echo "$EXLUDEDIR_FULL will be excluded from syncing on Dropbox."
xattr -w com.dropbox.ignored 1 $EXLUDEDIR_FULL
else
echo "$EXLUDEDIR_FULL is already excluded from syncing on Dropbox."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment