https://github.com/glanguage/npm_publisher
A shell script to update package on npm and on GitHub automatically.
https://github.com/glanguage/npm_publisher
git github npm shell
Last synced: 2 months ago
JSON representation
A shell script to update package on npm and on GitHub automatically.
- Host: GitHub
- URL: https://github.com/glanguage/npm_publisher
- Owner: GLanguage
- License: mit
- Created: 2020-05-07T15:41:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T01:21:39.000Z (about 6 years ago)
- Last Synced: 2025-01-15T22:26:58.315Z (over 1 year ago)
- Topics: git, github, npm, shell
- Language: Shell
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npm_publisher
A shell script to update package on npm and on GitHub automatically.
## Usage
Copy `/publish.sh` into your package directory.
Make sure:
- Your project is based on `git` (by `git init` or `git clone`)
- You have a branch for your new package version (by `git branch `)
- You are at the branch for the new version (by `git checkout `)
- You have a `npm` account and you have logged in (by `npm login`)
- Your package is not scoped (you can change the source code if you want)
- You have a `package.json` under your package directory
- You have a `"version"` property in `package.json`
- You have a remote repo `origin` (by `git remote add origin `)
Run:
```shell
$ chmod +x publish.sh
$ ./publish.sh
```
The script will ask for:
1. Your new version number
2. Name of the branch for the new version
3. Commit description
The script will do:
1. Publish the new version of the package to `npm`
2. Commit your new version branch and merge it to `master`
3. Change your current branch to `master` and delete the previous branch
4. Push the local `master` branch to the `master` branch in the remote repo `origin`
**Notice:** If commit description is not given (nothing entered) , then the default description will be `v`.