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

django-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-cli - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

5

package.json
{
"name": "django-cli",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -18,4 +18,5 @@ "main": "idnex.js",

"fs-extra": "^9.0.1",
"path": "^0.12.7"
"path": "^0.12.7",
"shelljs": "^0.8.4"
}
}

71

src/django.js

@@ -6,23 +6,64 @@ #! /usr/bin/env node

const chalk = require('chalk')
const path = require('path')
var shell = require('shelljs');
exports.copyTemplate = function (p) {
exports.copyTemplate = async function (args) {
console.log(process.cwd())
console.log(__dirname)
console.log(process.execPath)
let dest = process.cwd() + '/assets/components';
let temp = __dirname + '/../desc'
if (!fs.existsSync(dest)) {
fs.mkdirSync(dest);
} else {
if (!program.force) {
console.log(chalk.red('文件夹已存在 请使用 -f 命令'))
return
}
// 用户输入路径
let cpath = args[0];
const cwdPath = process.cwd();
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
console.log(chalk.yellow('正在移植...'))
shell.cd(__dirname + '/../')
const libDir = __dirname + '/../django-lib/'
if (fs.existsSync(libDir)) {
await exec(`rm -rf ${libDir}`)
}
const s = Date.now()
fs.copySync(temp, dest)
const e = Date.now()
console.log(chalk.green(`移植成功...${e-s}ms`))
shell.exec('git clone git@gitee.com:django_d/django-lib.git', {
async: true,
}, function () {
const e = Date.now()
let temp = __dirname + '/../django-lib/src/'
if (!cpath) cpath = 'DjangoLib'
let assets = cwdPath + '/assets/';
if (!fs.existsSync(assets)) {
console.log(chalk.red('未发现 "assets" 文件夹'))
return;
}
const target = assets + cpath
if (!fs.existsSync(target)) {
fs.mkdirSync(target);
} else {
if (!program.force) {
console.log(chalk.red(`${cpath} 文件夹已存在 请使用 -f 命令`))
return
}
}
console.log(chalk.yellow('正在移植...'))
fs.copySync(temp, target)
console.log(chalk.green(`移植成功...${e-s}ms`))
})
}
async function exec(command) {
return new Promise((resolve, reject) => {
shell.exec(command, {
async: true
}, (e) => {
resolve()
})
});
}
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