Skip to content

Commit 9b06c9c

Browse files
committed
clean up formatting
1 parent c4704e9 commit 9b06c9c

File tree

4 files changed

+29
-32
lines changed

4 files changed

+29
-32
lines changed

dev/cleanup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const { cwd, chdir } = process;
66
// -------------------------------------------------------------------------------------------------
77
// TODO 1 (after CLI upgrade): Configure cleanup to run using node-mongo command i.e. "node-mongo cleanup" not "npm run cleanup"
88
// TODO 2 (if possible): (I don't think you will need this TODO when this is done using the "node-mongo cleanup" command - or it might need slight modification)
9-
// update package.json cleanup script dynamically with the cleanup file path.
10-
// This means you will have to get the cleanup file name/path dynamically too...
9+
// update package.json cleanup script dynamically with the cleanup file path.
10+
// This means you will have to get the cleanup file name/path dynamically too...
1111
// Or... (instead) should cleanup script be handled a pre-commit hook or pre-push hook or something? - We'll see...
1212
// -------------------------------------------------------------------------------------------------
1313

dev/developer.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ const currentFileUrl = import.meta.url;
1212
let newUrl;
1313
if (process.platform === "darwin" || process.platform === "linux") {
1414
newUrl = new URL(currentFileUrl).pathname;
15-
} else
16-
newUrl = new URL(currentFileUrl).pathname.substring(
17-
new URL(currentFileUrl).pathname.indexOf("/") + 1
18-
);
15+
} else {
16+
newUrl = new URL(currentFileUrl).pathname.substring(new URL(currentFileUrl).pathname.indexOf("/") + 1);
17+
}
1918

20-
const cleanupFolderPath = dirname(newUrl);
19+
const cleanupFolderPath = dirname(newUrl);
2120
// Change directory into the dynamically gotten parent folder, then extract folder name from path
2221
chdir(cleanupFolderPath);
2322
const cleanupFolderName = basename(resolve());
@@ -49,4 +48,4 @@ export const repo = {
4948
],
5049
developerJsFileName,
5150
cleanupFolderName,
52-
}
51+
};

src/interfaces.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
export interface TemplateQuestions {
2-
type: string;
3-
name: string;
4-
message: string;
5-
choices: string[];
6-
default: string;
7-
}
2+
type: string;
3+
name: string;
4+
message: string;
5+
choices: string[];
6+
default: string;
7+
}
88

99
export type ItemplateOptions = string;
1010

1111
export interface Ioptions {
12-
skipPrompts: boolean;
13-
git: boolean;
14-
skipGit: string | undefined;
15-
folderName: string;
16-
template: ItemplateOptions;
17-
targetDirectory: string;
18-
templateDirectory: string;
19-
runInstall: boolean;
20-
skipInstall: boolean;
21-
help: string | boolean;
22-
version: string | boolean;
12+
skipPrompts: boolean;
13+
git: boolean;
14+
skipGit: string | undefined;
15+
folderName: string;
16+
template: ItemplateOptions;
17+
targetDirectory: string;
18+
templateDirectory: string;
19+
runInstall: boolean;
20+
skipInstall: boolean;
21+
help: string | boolean;
22+
version: string | boolean;
2323
}
2424

2525
export interface IFoldernameAnswers {

src/main.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ export let downloadTemplateKit = async (options: Ioptions) => {
9494
let newUrl;
9595
if (process.platform === "darwin" || process.platform === "linux") {
9696
newUrl = new URL(currentFileUrl).pathname;
97-
} else
98-
newUrl = new URL(currentFileUrl).pathname.substring(
99-
new URL(currentFileUrl).pathname.indexOf("/") + 1
100-
);
97+
} else {
98+
newUrl = new URL(currentFileUrl).pathname.substring(new URL(currentFileUrl).pathname.indexOf("/") + 1);
99+
}
101100

102101
const templateDir = path.resolve(newUrl, '../../../templates', options.template.toLowerCase());
103102

@@ -109,9 +108,8 @@ export let downloadTemplateKit = async (options: Ioptions) => {
109108
execa('npx', ['npe','name',options.folderName], {
110109
cwd: options.targetDirectory
111110
}).stdout?.pipe(process.stdout);
112-
})
113-
114-
}catch (err) {
111+
});
112+
} catch (err) {
115113
console.error(`\n%s Template name or directory path is (probably) incorrect`, chalk.red.bold('ERROR'));
116114
userSupport();
117115
process.exit(1);

0 commit comments

Comments
 (0)