Skip to content

Commit

Permalink
fix prettier command on spaces in path
Browse files Browse the repository at this point in the history
  • Loading branch information
omeraplak committed Aug 6, 2021
1 parent 42151da commit 8b34615
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superplate-cli",
"version": "1.2.1",
"version": "1.2.2",
"description": "The frontend boilerplate with superpowers",
"license": "MIT",
"repository": {
Expand Down
11 changes: 4 additions & 7 deletions src/saofile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ const saoConfig: GeneratorConfig = {
* Package Manager
*/

sao.answers = {
...sao.answers,
pm: BinaryHelper.CanUseYarn() ? sao.answers.pm : "npm",
};
sao.answers.pm = BinaryHelper.CanUseYarn() ? sao.answers.pm : "npm";

const pmRun = sao.answers.pm === "yarn" ? "yarn" : "npm run";

Expand Down Expand Up @@ -296,7 +293,7 @@ const saoConfig: GeneratorConfig = {
/**
* Format generated project
*/
await promisify(exec)(`npx prettier ${saoInstance.outDir} --write`);
await promisify(exec)(`npx prettier "${saoInstance.outDir}" --write`);

/**
* Create an initial commit
Expand All @@ -305,11 +302,11 @@ const saoConfig: GeneratorConfig = {
try {
// add
await promisify(exec)(
`git --git-dir=${saoInstance.outDir}/.git/ --work-tree=${saoInstance.outDir}/ add -A`,
`git --git-dir="${saoInstance.outDir}"/.git/ --work-tree="${saoInstance.outDir}"/ add -A`,
);
// commit
await promisify(exec)(
`git --git-dir=${saoInstance.outDir}/.git/ --work-tree=${saoInstance.outDir}/ commit -m "initial commit with superplate"`,
`git --git-dir="${saoInstance.outDir}"/.git/ --work-tree="${saoInstance.outDir}"/ commit -m "initial commit with superplate"`,
);
saoInstance.logger.info("created an initial commit.");
} catch (_) {
Expand Down

0 comments on commit 8b34615

Please sign in to comment.