prettier with semicolon
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
const { system, filesystem } = require('gluegun')
|
const { system, filesystem } = require('gluegun');
|
||||||
|
|
||||||
const src = filesystem.path(__dirname, '..')
|
const src = filesystem.path(__dirname, '..');
|
||||||
|
|
||||||
const cli = async cmd =>
|
const cli = async cmd =>
|
||||||
system.run('node ' + filesystem.path(src, 'bin', 'pwcli') + ` ${cmd}`)
|
system.run('node ' + filesystem.path(src, 'bin', 'pwcli') + ` ${cmd}`);
|
||||||
|
|
||||||
test('outputs version', async () => {
|
test('outputs version', async () => {
|
||||||
const output = await cli('--version')
|
const output = await cli('--version');
|
||||||
expect(output).toContain('0.0.1')
|
expect(output).toContain('0.0.1');
|
||||||
})
|
});
|
||||||
|
|
||||||
test('outputs help', async () => {
|
test('outputs help', async () => {
|
||||||
const output = await cli('--help')
|
const output = await cli('--help');
|
||||||
expect(output).toContain('0.0.1')
|
expect(output).toContain('0.0.1');
|
||||||
})
|
});
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@
|
|||||||
"testEnvironment": "node"
|
"testEnvironment": "node"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"semi": false,
|
"semi": true,
|
||||||
"singleQuote": true
|
"singleQuote": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
const { build } = require('gluegun')
|
const { build } = require('gluegun');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the cli and kick it off
|
* Create the cli and kick it off
|
||||||
@@ -23,7 +23,7 @@ async function run(argv) {
|
|||||||
}
|
}
|
||||||
}) // provides default for help, h, --help, -h
|
}) // provides default for help, h, --help, -h
|
||||||
// .version() // provides default for version, v, --version, -v
|
// .version() // provides default for version, v, --version, -v
|
||||||
.create()
|
.create();
|
||||||
// enable the following method if you'd like to skip loading one of these core extensions
|
// enable the following method if you'd like to skip loading one of these core extensions
|
||||||
// this can improve performance if they're not necessary for your project:
|
// this can improve performance if they're not necessary for your project:
|
||||||
// .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching', 'package-manager'])
|
// .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching', 'package-manager'])
|
||||||
@@ -34,4 +34,4 @@ async function run(argv) {
|
|||||||
return toolbox;
|
return toolbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { run }
|
module.exports = { run };
|
||||||
|
|||||||
+19
-8
@@ -1,5 +1,5 @@
|
|||||||
import chalk = require("chalk");
|
import chalk = require('chalk');
|
||||||
const os = require("os");
|
const os = require('os');
|
||||||
var snakeCase = require('lodash.snakecase');
|
var snakeCase = require('lodash.snakecase');
|
||||||
const { AutoComplete, Confirm, Input } = require('enquirer');
|
const { AutoComplete, Confirm, Input } = require('enquirer');
|
||||||
|
|
||||||
@@ -14,32 +14,43 @@ export type TConfig = {
|
|||||||
export const getSettings = async (toolbox): Promise<TConfig | null> => {
|
export const getSettings = async (toolbox): Promise<TConfig | null> => {
|
||||||
const { filesystem, print } = toolbox;
|
const { filesystem, print } = toolbox;
|
||||||
try {
|
try {
|
||||||
return await filesystem.readAsync(`${os.homedir()}/.pwcli_settings`, "json");
|
return await filesystem.readAsync(
|
||||||
|
`${os.homedir()}/.pwcli_settings`,
|
||||||
|
'json'
|
||||||
|
);
|
||||||
} catch {
|
} catch {
|
||||||
print.error(`
|
print.error(`
|
||||||
|
|
||||||
No config found, please run [ ${chalk.cyan('pwcli s se')} ] or setup > settings from the menu.
|
No config found, please run [ ${chalk.cyan(
|
||||||
|
'pwcli s se'
|
||||||
|
)} ] or setup > settings from the menu.
|
||||||
|
|
||||||
`);
|
`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCurrentBranch = async (path: string, toolbox): Promise<string | null> => {
|
export const getCurrentBranch = async (
|
||||||
|
path: string,
|
||||||
|
toolbox
|
||||||
|
): Promise<string | null> => {
|
||||||
const { system } = toolbox;
|
const { system } = toolbox;
|
||||||
const config = await getSettings(toolbox);
|
const config = await getSettings(toolbox);
|
||||||
if (config.photowall_repo) {
|
if (config.photowall_repo) {
|
||||||
// git rev-parse --abbrev-ref HEAD
|
// git rev-parse --abbrev-ref HEAD
|
||||||
const branch = await system.run('git rev-parse --abbrev-ref HEAD', {cwd: config.photowall_repo, trim: true});
|
const branch = await system.run('git rev-parse --abbrev-ref HEAD', {
|
||||||
|
cwd: config.photowall_repo,
|
||||||
|
trim: true
|
||||||
|
});
|
||||||
console.log(`branch`, branch);
|
console.log(`branch`, branch);
|
||||||
return branch;
|
return branch;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const issueToBranchName = (issue) => {
|
export const issueToBranchName = issue => {
|
||||||
return `${issue.number}-${snakeCase(issue.title).substr(0, 40)}`;
|
return `${issue.number}-${snakeCase(issue.title).substr(0, 40)}`;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const confirmMessage = async (message: string) => {
|
export const confirmMessage = async (message: string) => {
|
||||||
const confirm = new Confirm({
|
const confirm = new Confirm({
|
||||||
|
|||||||
Reference in New Issue
Block a user