
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
git-directory-deploy
Advanced tools
Deploy a subdirectory from a git repo to a different branch. Useful to deploy to GitHub Pages.
The shell script portion of this code is from X1011/git-directory-deploy, and it's best explained in that README:
Unlike the git-subtree approach, it does not require the generated files be committed to the source branch. It keeps a linear history on the deploy branch and does not make superfluous commits or deploys when the generated files do not change.
This repo accomplishes a few other things:
npm so I can use it as a devDep in projectsI normally use it like this:
cd project/ # Assumes a git directory with a package.json
echo _build >> .gitignore
npm install git-directory-deploy --save-dev
touch build.js # For however you want to build your static files
Then add these scripts to package.json:
"scripts": {
"build": "node build.js", // should write files to _build/
"deploy": "npm run build && git-directory-deploy --directory _build/"
}
Then: npm run deploy!
Check out npm-v0-finder for an example.
For global use:
npm install -g git-directory-deploy
cd projects/i-want-to-deploy/
git-directory-deploy --directory _dist --branch gh-pages
Or for use in via npm run-script:
npm install git-directory-deploy --save-dev
and then use it in your package.json likes this:
"scripts": {
"deploy": "git-directory-deploy --directory _dist --branch gh-pages"
}
git-directory-deploy [args]--directory [_site]The subdirectory to deploy. Defaults to _site/.
--branch [gh-pages]The branch that will receive the deploy. Defaults to gh-pages.
--repo [origin]The repo to push the deploy to. Defaults to origin.
--username [git config user.name]The username that will be associated with the deploy commit. This will always be set to the current user.name from git config, but if that is not set, then it can be set via this flag.
--email [git config user.email]The email that will be associated with the deploy commit. This will always be set to the current user.email from git config, but if that is not set, then it can be set via this flag.
--messageAppend something to the commit message. The message will look like this:
publish: $COMMIT_MESSAGE $MESSAGE
generated from commit $COMMIT_HASH
--verboseBe louder.
--allow_emptyAllow the --directory to be empty.
--ignore_removalDeploy will not override files that are in the remote repo but not in the deploy directory.
MIT
The script at bin/git-directory-deploy.sh is Copyright Daniel Smith.
See the file for terms.
FAQs
Deploy a git directory to a branch.
The npm package git-directory-deploy receives a total of 2,597 weekly downloads. As such, git-directory-deploy popularity was classified as popular.
We found that git-directory-deploy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.