Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swagit

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagit - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

8

bin/swagit.js

@@ -23,2 +23,10 @@ #!/usr/bin/env node

process.stdin.setEncoding('utf8');
process.stdin.on('data', chunk => {
if (chunk === '\u001b') {
// ESC
process.exit(0);
}
});
args.option('d', 'Select branches which you want to delete');

@@ -25,0 +33,0 @@

17

lib/git.js
const git = require('simple-git/promise');
const { white } = require('chalk');
const getGitBranches = async () => {
const result = await git().branch();
return result;
};
exports.checkGit = async () => {

@@ -18,4 +14,11 @@ try {

exports.getBranches = async () => {
const { current, all } = await getGitBranches();
return all.filter(branch => branch !== current);
const { branches } = await git().branch();
return Object.keys(branches)
.filter(name => !(branches[name].current || name.startsWith('remotes')))
.map(name => {
const { commit, label } = branches[name];
const description = white(`[${commit}] ${label}`);
return { name: `${name} ${description}`, value: name };
});
};

@@ -22,0 +25,0 @@

@@ -12,3 +12,3 @@ {

},
"version": "0.1.1",
"version": "0.1.2",
"bin": {

@@ -15,0 +15,0 @@ "sg": "./bin/swagit.js",

# Swagit
![Swagit](https://i.imgur.com/QBNMDxU.png)
## Usage
Firstly, install the package from [npm](https://npmjs.com/release):
```bash
npm install -g swagit
```
Of course you can use [Yarn](https://yarnpkg.com/en/) to install it:
```bash
yarn global add swagit
```
Once that's done, you can run this command inside your project's directory:
```bash
swagit
# shotcut
sg
```
<img src="https://i.imgur.com/lZE5CG1.gif" width="500">
### Options
#### `-d`
Open a interactive to select branches which will be delete.
<img src="https://i.imgur.com/8Vk1yqS.gif" width="800">
## License
MIT © [jigsawye](https://jigsawye.com)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc