@pixelblock/cli
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -17,10 +17,12 @@ #!/usr/bin/env node | ||
.action(async () => { | ||
const inquirer = await getInquirer(); | ||
inquirer.prompt([ | ||
{ | ||
type: 'input', | ||
name: 'component', | ||
message: 'Which component do you want to install?' | ||
} | ||
]).then(answers => { | ||
try { | ||
const inquirer = await getInquirer(); | ||
const answers = await inquirer.prompt([ | ||
{ | ||
type: 'input', | ||
name: 'component', | ||
message: 'Which component do you want to install?' | ||
} | ||
]); | ||
const component = answers.component; | ||
@@ -33,5 +35,5 @@ const templatesDir = path.join(__dirname, '../templates'); | ||
if (fs.existsSync(sourceFile)) { | ||
fs.ensureDirSync(destinationDir); | ||
fs.copyFileSync(sourceFile, destinationFile); | ||
if (await fs.pathExists(sourceFile)) { | ||
await fs.ensureDir(destinationDir); | ||
await fs.copyFile(sourceFile, destinationFile); | ||
console.log(`Component ${component} installed successfully.`); | ||
@@ -41,7 +43,7 @@ } else { | ||
} | ||
}).catch(error => { | ||
} catch (error) { | ||
console.error('Error:', error); | ||
}); | ||
} | ||
}); | ||
program.parse(process.argv); |
{ | ||
"name": "@pixelblock/cli", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2942
62