prettier with semicolon

This commit is contained in:
Arwid Thornström
2022-09-15 13:17:13 +02:00
parent 83a5ae9ace
commit d7fc3ecf95
4 changed files with 32 additions and 21 deletions
+19 -8
View File
@@ -1,5 +1,5 @@
import chalk = require("chalk");
const os = require("os");
import chalk = require('chalk');
const os = require('os');
var snakeCase = require('lodash.snakecase');
const { AutoComplete, Confirm, Input } = require('enquirer');
@@ -14,32 +14,43 @@ export type TConfig = {
export const getSettings = async (toolbox): Promise<TConfig | null> => {
const { filesystem, print } = toolbox;
try {
return await filesystem.readAsync(`${os.homedir()}/.pwcli_settings`, "json");
return await filesystem.readAsync(
`${os.homedir()}/.pwcli_settings`,
'json'
);
} catch {
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;
}
};
export const getCurrentBranch = async (path: string, toolbox): Promise<string | null> => {
export const getCurrentBranch = async (
path: string,
toolbox
): Promise<string | null> => {
const { system } = toolbox;
const config = await getSettings(toolbox);
if (config.photowall_repo) {
// 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);
return branch;
}
return null;
};
export const issueToBranchName = (issue) => {
export const issueToBranchName = issue => {
return `${issue.number}-${snakeCase(issue.title).substr(0, 40)}`;
}
};
export const confirmMessage = async (message: string) => {
const confirm = new Confirm({