From 5d6fb5e1ac84878c5cb525db9c5f3cd2cab5db7d Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 8 Feb 2020 04:34:56 +0100 Subject: [PATCH] fix(cli): attempt to fix permissions on linux --- @commitlint/cli/cli-bin.js | 2 ++ @commitlint/cli/index.js | 2 +- @commitlint/cli/package.json | 2 +- @commitlint/cli/src/cli.test.ts | 2 +- @commitlint/cli/src/cli.ts | 12 +++++++----- 5 files changed, 12 insertions(+), 8 deletions(-) create mode 100755 @commitlint/cli/cli-bin.js mode change 100755 => 100644 @commitlint/cli/src/cli.ts diff --git a/@commitlint/cli/cli-bin.js b/@commitlint/cli/cli-bin.js new file mode 100755 index 0000000000..4856fd706c --- /dev/null +++ b/@commitlint/cli/cli-bin.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./lib/cli.js'); diff --git a/@commitlint/cli/index.js b/@commitlint/cli/index.js index 6babb12a58..d8ab7a8f93 100644 --- a/@commitlint/cli/index.js +++ b/@commitlint/cli/index.js @@ -1,3 +1,3 @@ const path = require('path'); -module.exports = path.join(__dirname, 'lib/cli.js'); +module.exports = path.join(__dirname, 'cli-bin.js'); diff --git a/@commitlint/cli/package.json b/@commitlint/cli/package.json index 54bec17900..d488311e07 100644 --- a/@commitlint/cli/package.json +++ b/@commitlint/cli/package.json @@ -8,7 +8,7 @@ "!*.test.js*" ], "bin": { - "commitlint": "./lib/cli.js" + "commitlint": "./cli-bin.js" }, "scripts": { "deps": "dep-check", diff --git a/@commitlint/cli/src/cli.test.ts b/@commitlint/cli/src/cli.test.ts index bea5108ac5..66dce25ea4 100644 --- a/@commitlint/cli/src/cli.test.ts +++ b/@commitlint/cli/src/cli.test.ts @@ -4,7 +4,7 @@ import execa from 'execa'; import merge from 'lodash/merge'; import fs from 'fs-extra'; -const bin = require.resolve('../lib/cli.js'); +const bin = require.resolve('../cli-bin.js'); interface TestOptions { cwd: string; diff --git a/@commitlint/cli/src/cli.ts b/@commitlint/cli/src/cli.ts old mode 100755 new mode 100644 index 73bea7a3d0..0a3a99cd2c --- a/@commitlint/cli/src/cli.ts +++ b/@commitlint/cli/src/cli.ts @@ -1,4 +1,3 @@ -#!/usr/bin/env node import load from '@commitlint/load'; import lint from '@commitlint/lint'; import read from '@commitlint/read'; @@ -63,7 +62,8 @@ const cli = yargs }, from: { alias: 'f', - description: 'lower end of the commit range to lint; applies if edit=false', + description: + 'lower end of the commit range to lint; applies if edit=false', type: 'string' }, format: { @@ -73,7 +73,8 @@ const cli = yargs }, 'parser-preset': { alias: 'p', - description: 'configuration preset to use for conventional-commits-parser', + description: + 'configuration preset to use for conventional-commits-parser', type: 'string' }, quiet: { @@ -84,7 +85,8 @@ const cli = yargs }, to: { alias: 't', - description: 'upper end of the commit range to lint; applies if edit=false', + description: + 'upper end of the commit range to lint; applies if edit=false', type: 'string' }, version: { @@ -110,7 +112,7 @@ main(cli).catch(err => { process.exit(1); } throw err; - }, 0) + }, 0); }); async function main(options: CliFlags) {