Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-hello-1-17y

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-hello-1-17y - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

63

index.js
#!/usr/bin/env node
var name = process.argv[2];
var shell = require("shelljs");
// var name = process.argv[2];
// var shell = require("shelljs");
//
// shell.exec("echo hello " + name);
// shell.mkdir('-p', "nihao")
// if (!shell.which('git')) {
// shell.echo('Sorry, this script requires git');
// shell.exit(1);
// }
//
// shell.exec('git clone "git@git.guazi-corp.com:bi/bi_fe.git"')
//
shell.exec("echo hello " + name);
shell.mkdir('-p', "nihao")
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
const path = require('path');
const chalk = require('chalk');
const fs = require('fs-extra');
const inquirer = require('inquirer');
const ora = require('ora');
const download = require('download-git-repo');
const exists = require('fs').existsSync;
shell.exec('git clone "git@git.guazi-corp.com:bi/bi_fe.git"')
const cwd = process.cwd();
const origin = 'goWrongWay/React-Redux-Saga-Reselect-Starter-Kit';
const questions = [{
type: 'input',
name: 'name',
message: 'input project name:',
}, {
type: 'input',
name: 'path',
message: 'witch directory do you want to init to ? (default is current directory ./):',
}];
inquirer.prompt(questions).then(function (answers) {
const projectName = answers.name || 'React-Redux-Saga-Reselect-Starter-Kit';
const targetPath = path.join(cwd, answers.path || './');
if (exists(path.join(targetPath, projectName))) {
console.log(chalk.red('exit: template is already exists'));
return;
}
const spinner = ora('downloading template...');
spinner.start();
download(origin, path.join(targetPath, projectName), { clone: false }, function (err) {
spinner.stop();
if (err) {
console.log(chalk.red(`Failed to download repo https://github.com/${origin}`, err));
} else {
console.log(chalk.green(`Success to download repo https://github.com/${origin} to ${targetPath}`));
}
})
});
{
"name": "node-hello-1-17y",
"version": "1.0.2",
"version": "2.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"chalk": "^2.3.0",
"download-git-repo": "^1.0.1",
"fs-extra": "^4.0.2",
"inquirer": "^3.3.0",
"ora": "^1.3.0",
"shelljs": "^0.7.8"

@@ -8,0 +13,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc