git-dance
Advanced tools
Comparing version 1.0.0-beta.4 to 1.0.0-beta.6
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -11,4 +10,6 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
const yargs = require("yargs"); | ||
const options = yargs.usage("Usage: -s <url>"). | ||
import { usage } from 'yargs'; | ||
import { sync } from 'command-exists'; | ||
import * as tmp from 'tmp'; | ||
const options = usage("Usage: -s <url>"). | ||
option("s", { alias: "src", description: "源仓库", type: "string", demandOption: true }). | ||
@@ -18,16 +19,13 @@ usage("Usage: -d <url>"). | ||
.argv; | ||
const commandExistsSync = require('command-exists').sync; | ||
const commandExistsSync = sync; | ||
if (!commandExistsSync("git")) { | ||
console.error("git 命令不存在"); | ||
process.exit(99); | ||
console.error("git 命令不存在,请检查~"); | ||
process.exit(1); | ||
} | ||
const exec = require('await-exec'); | ||
const tmp = require('tmp'); | ||
tmp.dir((err, path, cleanupCallback) => __awaiter(void 0, void 0, void 0, function* () { | ||
if (err) | ||
throw err; | ||
// clone mirror | ||
let result = yield exec(`git clone --mirror ${options.src} ${path}`); | ||
console.log(result); | ||
// sync to remote | ||
result = yield exec(`git remote update --prune`, { cwd: path }); | ||
@@ -34,0 +32,0 @@ console.log(result); |
@@ -38,4 +38,7 @@ "use strict"; | ||
}; | ||
var yargs = require("yargs"); | ||
var options = yargs.usage("Usage: -s <url>"). | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var yargs_1 = require("yargs"); | ||
var command_exists_1 = require("command-exists"); | ||
var tmp = require("tmp"); | ||
var options = (0, yargs_1.usage)("Usage: -s <url>"). | ||
option("s", { alias: "src", description: "源仓库", type: "string", demandOption: true }). | ||
@@ -45,9 +48,8 @@ usage("Usage: -d <url>"). | ||
.argv; | ||
var commandExistsSync = require('command-exists').sync; | ||
var commandExistsSync = command_exists_1.sync; | ||
if (!commandExistsSync("git")) { | ||
console.error("git 命令不存在"); | ||
process.exit(99); | ||
console.error("git 命令不存在,请检查~"); | ||
process.exit(1); | ||
} | ||
var exec = require('await-exec'); | ||
var tmp = require('tmp'); | ||
tmp.dir(function (err, path, cleanupCallback) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -66,3 +68,2 @@ var result; | ||
case 2: | ||
// sync to remote | ||
result = _a.sent(); | ||
@@ -69,0 +70,0 @@ console.log(result); |
{ | ||
"name": "git-dance", | ||
"version": "1.0.0-beta.4", | ||
"version": "1.0.0-beta.6", | ||
"description": "", | ||
"main": "./lib/index.js", | ||
"bin": "./bin/git-dance.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build:commonjs": "rimraf lib && tsc --target es5 --outDir lib --module commonjs --declaration", | ||
"build:es": "rimraf es && tsc --target es6 --outDir es --module es6", | ||
"build": "npm run build:commonjs && npm run build:es", | ||
"ts": "ts-node src/", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"keywords": [], | ||
"author": "lexmin0412 <zhangle_media@hotmail.com>", | ||
"bin": "./bin/git-dance.js", | ||
"keywords": [ | ||
"git" | ||
], | ||
"author": "lexmin0412 <zhangle_dev@outlook.com>", | ||
"license": "ISC", | ||
"dependencies": { | ||
"await-exec": "^0.1.2", | ||
"dependencies": { | ||
"await-exec": "^0.1.2", | ||
"command-exists": "^1.2.9", | ||
"tmp": "^0.2.1", | ||
"yargs": "^17.5.1" | ||
}, | ||
}, | ||
"devDependencies": { | ||
"@types/command-exists": "^1.2.0", | ||
"@types/node": "^18.0.0", | ||
"@types/tmp": "^0.2.3", | ||
"@types/yargs": "^17.0.10", | ||
"rimraf": "^3.0.2", | ||
@@ -36,6 +34,9 @@ "ts-node": "^10.8.1", | ||
"module": "./es/index.js", | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
} | ||
} | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build:commonjs": "rimraf lib && tsc --target es5 --outDir lib --module commonjs --declaration", | ||
"build:es": "rimraf es && tsc --target es6 --outDir es --module es6", | ||
"build": "pnpm run build:commonjs && pnpm run build:es", | ||
"ts": "ts-node src/" | ||
} | ||
} |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7485
7
119