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

@chevtek/cli

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chevtek/cli - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

6

bin/generators/full-stack/index.js

@@ -68,3 +68,3 @@ "use strict";

var npxCmd = /^win/.test(process.platform) ? "npx.cmd" : "npx";
exports.default = (function (dir) { return __awaiter(void 0, void 0, void 0, function () {
exports.default = (function (dir, force) { return __awaiter(void 0, void 0, void 0, function () {
var dirExists, files;

@@ -82,4 +82,4 @@ return __generator(this, function (_a) {

files = _a.sent();
if (files.length > 0) {
throw new Error("Target directory is not empty.");
if (!force && (files.length > 1 || path_1.default.basename(files[0]) !== ".git")) {
throw new Error("Target directory is not empty. Supply --force to generate anyway.");
}

@@ -86,0 +86,0 @@ return [3 /*break*/, 5];

@@ -57,2 +57,8 @@ #!/usr/bin/env node

});
yargs.option("force", {
type: "boolean",
default: false,
alias: "f",
description: chalk_1.default.redBright("Force template generation even if directory is not empty.")
});
yargs.positional("path", {

@@ -59,0 +65,0 @@ type: "string",

@@ -28,3 +28,3 @@ import fs from "fs";

export default async (dir: string) => {
export default async (dir: string, force: boolean) => {
console.log(chalk.greenBright("Generating full-stack scaffold..."));

@@ -34,4 +34,4 @@ const dirExists = await checkDirectoryExists(dir);

const files = await readdir(dir);
if (files.length > 0) {
throw new Error("Target directory is not empty.");
if (!force && (files.length > 1 || path.basename(files[0]) !== ".git")) {
throw new Error("Target directory is not empty. Supply --force to generate anyway.");
}

@@ -38,0 +38,0 @@ } else {

@@ -20,2 +20,8 @@ #!/usr/bin/env node

});
yargs.option("force", {
type: "boolean",
default: false,
alias: "f",
description: chalk.redBright("Force template generation even if directory is not empty.")
});
yargs.positional("path", {

@@ -22,0 +28,0 @@ type: "string",

{
"name": "@chevtek/cli",
"version": "1.0.16",
"version": "1.0.17",
"description": "",

@@ -5,0 +5,0 @@ "bin": {

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