@commercetools-frontend/create-mc-app
Advanced tools
Comparing version 16.0.0 to 16.0.2-canary.6
{ | ||
"name": "@commercetools-frontend/create-mc-app", | ||
"version": "16.0.0", | ||
"version": "16.0.2-canary.6+36ed8980", | ||
"description": "Create Merchant Center applications to quickly get up and running", | ||
@@ -35,3 +35,3 @@ "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues", | ||
}, | ||
"gitHead": "dadb41974483b48614dd6c9225d055c746e01465" | ||
"gitHead": "36ed8980f782f9eef5608b9efbb09cb6392fd239" | ||
} |
@@ -0,1 +1,2 @@ | ||
const fs = require('fs'); | ||
const os = require('os'); | ||
@@ -53,4 +54,7 @@ const path = require('path'); | ||
const sanitizedProjectDirectoryPath = projectDirectoryPath | ||
// Escape white spaces | ||
.replace(/ /g, '\\ '); | ||
try { | ||
execSync(`mv ${templateFolderPath} ${projectDirectoryPath}`, { | ||
execSync(`mv ${templateFolderPath} ${sanitizedProjectDirectoryPath}`, { | ||
stdio: 'inherit', | ||
@@ -60,5 +64,15 @@ }); | ||
throw new Error( | ||
`Could not copy template "${templateName}" into "${projectDirectoryPath}"` | ||
`Could not copy template "${templateName}" into "${sanitizedProjectDirectoryPath}"` | ||
); | ||
} | ||
const templatePackageJsonPath = path.join( | ||
projectDirectoryPath, | ||
'package.json' | ||
); | ||
if (!fs.existsSync(templatePackageJsonPath)) { | ||
throw new Error( | ||
`Unable to verify that the template application has a package.json at "${templatePackageJsonPath}"` | ||
); | ||
} | ||
}; |
@@ -13,7 +13,7 @@ const os = require('os'); | ||
const packageJsonPath = path.join(projectDirectoryPath, 'package.json'); | ||
// Change the package name based on the given project directory name | ||
const appPackageJson = JSON.parse( | ||
fs.readFileSync(path.join(projectDirectoryPath, 'package.json'), { | ||
encoding: 'utf8', | ||
}) | ||
fs.readFileSync(packageJsonPath, { encoding: 'utf8' }) | ||
); | ||
@@ -30,3 +30,3 @@ const updatedAppPackageJson = Object.assign({}, appPackageJson, { | ||
fs.writeFileSync( | ||
path.join(projectDirectoryPath, 'package.json'), | ||
packageJsonPath, | ||
JSON.stringify(updatedAppPackageJson, null, 2) + os.EOL, | ||
@@ -33,0 +33,0 @@ { encoding: 'utf8' } |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14659
327
1
3
5