Created
December 15, 2021 02:35
-
-
Save ogra/64dc3688bba35d7b255f800f6c67e062 to your computer and use it in GitHub Desktop.
Exclude node_modules directory from syncing on Dropbox. (macOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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