Skip to content

Instantly share code, notes, and snippets.

@hi-ogawa
Last active July 2, 2022 03:45
Show Gist options
  • Save hi-ogawa/dc5ffab1ac94aaed90248e403a5c29d8 to your computer and use it in GitHub Desktop.
Save hi-ogawa/dc5ffab1ac94aaed90248e403a5c29d8 to your computer and use it in GitHub Desktop.
vscode gist auto save

vscode gist auto save

  • .vscode/settings.json
{
  "emeraldwalk.runonsave": {
    "commands": [
      {
        "match": "gists/[^/]+/*",
        "cmd": "cd '${fileDirname}' && git commit --allow-empty-message -am '' && git push"
      }
    ]
  }
}
  • example
git clone [email protected]:5b3dd93d5abf4e395f785c20c6d773e0 "gists/Reading Next.js"

via entr command

# auto generate phony targets
.PHONY: $(shell grep --no-filename -E '^([a-zA-Z_-]|\/)+:' $(MAKEFILE_LIST) | sed 's/:.*//')

auto-save:
	find . -mindepth 2 -type f ! -path '*/.git/*' | entr -s -n -p 'cd $$(dirname $$0) && git commit -am "auto-save" && git push'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment