Socket
Socket
Sign inDemoInstall

gitmoji-cli

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitmoji-cli - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

6

cli.js

@@ -53,3 +53,3 @@ #!/usr/bin/env node

if (cli.flags.commit) {
gitmojiCli.ask();
gitmojiCli.ask('client');
}

@@ -60,1 +60,5 @@

}
if (cli.flags.hook) {
gitmojiCli.ask('hook');
}

2

package.json
{
"name": "gitmoji-cli",
"version": "1.1.0",
"version": "1.1.1",
"description": "A gitmoji client for using emojis on commit messages.",

@@ -5,0 +5,0 @@ "engines": {

@@ -19,3 +19,3 @@ 'use strict';

const path = `${process.env.PWD}/.git/hooks`;
const fileContents = `#!/bin/sh\n# gitmoji as a commit hook\ngitmoji -c $1`;
const fileContents = `#!/bin/sh\n# gitmoji as a commit hook\nexec < /dev/tty\ngitmoji --hook $1`;

@@ -50,3 +50,3 @@ fs.writeFile(`${path}/prepare-commit-msg`, fileContents, {mode: 755}, err => {

ask() {
ask(mode) {
if (this._isAGitRepo('.git')) {

@@ -60,3 +60,11 @@ return this._gitmojiApiClient.request({

inquirer.prompt(questions).then(answers => {
this._commit(answers);
switch (mode) {
case 'client':
this._commit(answers);
break;
case 'hook':
this._hook(answers);
break;
}
});

@@ -66,6 +74,13 @@ })

}
console.error(chalk.red('ERROR: This directory is not a git repository.'));
}
_hook(answers) {
const commitTitle = `${answers.gitmoji} ${answers.title}`;
const reference = (answers.reference) ? `#${answers.reference}` : '';
const commitBody = `${answers.message} ${reference}`;
fs.writeFileSync(process.argv[3], `${commitTitle}\n${commitBody}`);
}
_commit(answers) {

@@ -72,0 +87,0 @@ const commitTitle = `${answers.gitmoji} ${answers.title}`;

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