@adactive/arc-clock
Advanced tools
Comparing version 0.0.1-y.32 to 0.0.1-y.33
45
cli.js
@@ -5,19 +5,34 @@ #!/usr/bin/env node | ||
var chalk = require('chalk'); | ||
const chalk = require('chalk'); | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
var currentNodeVersion = process.versions.node; | ||
var semver = currentNodeVersion.split('.'); | ||
var major = semver[0]; | ||
const commander = require('commander'); | ||
if (major < 10) { | ||
console.error( | ||
chalk.red( | ||
'You are running Node ' + | ||
currentNodeVersion + | ||
'.\n' + | ||
'Create React App requires Node 4 or higher. \n' + | ||
'Please update your version of Node.' | ||
) | ||
); | ||
process.exit(1); | ||
let cmdValue = ''; | ||
const program = require('commander'); | ||
program | ||
.usage('npx @adactive/arc-clock copy') | ||
.option('--no-install', 'npx option') | ||
.option('--less-only', 'just copy the style') | ||
.action(function (cmd) { | ||
cmdValue = cmd; | ||
}) | ||
.parse(process.argv); | ||
console.log(program) | ||
if(cmdValue === "copy") { | ||
if(program.lessOnly) { | ||
fs.copy(`${__dirname}/src/adsumClock.less`, path.resolve('src/components/adsum-clock/adsumClock.less')) | ||
.then(() => console.log(chalk.green("Success!")) ) | ||
.catch(err => console.error(err)) | ||
} else { | ||
fs.copy(`${__dirname}/index.js`, path.resolve('src/components/adsum-clock/index.js')) | ||
.then(() => fs.copy(`${__dirname}/src`, path.resolve('src/components/adsum-clock/src'))) | ||
.then(() => console.log(chalk.green("Success!")) ) | ||
.catch(err => console.error(err)) | ||
} | ||
} | ||
{ | ||
"name": "@adactive/arc-clock", | ||
"version": "0.0.1-y.32", | ||
"version": "0.0.1-y.33", | ||
"description": "Adsum Clock Component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -44,2 +44,11 @@ # Clock component | ||
style : Css react object | ||
``` | ||
``` | ||
## Copy component inside your project src folder | ||
### Less only | ||
`npx @adactive/arc-clock copy --less-only` | ||
### Full copy | ||
`npx @adactive/arc-clock copy` |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
9723
197
53
1