Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created October 7, 2020 17:50
Show Gist options
  • Save kopiro/08b552fa1ad459804132ff1b82e42b59 to your computer and use it in GitHub Desktop.
Save kopiro/08b552fa1ad459804132ff1b82e42b59 to your computer and use it in GitHub Desktop.
Sync your ~/Projects directories with VSCode Project Manager extension
sync-code-projects() {
CODE_PROJECTS_FILE="$HOME/Library/Application Support/Code/User/projects.json" && \
echo "[" > "$CODE_PROJECTS_FILE" && \
find ~/Projects \
-maxdepth 1 \
-type d \
-execdir echo "{ \"name\": \"{}\", \"rootPath\": \"$HOME/Projects/{}\", \"enabled\": true }," >> "$CODE_PROJECTS_FILE" \; &&
echo "{}]" >> "$CODE_PROJECTS_FILE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment