Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env node
// This rule is confused by us being TypeScript (the package.json file points at
// our JS output, so we are not technically a "binary" in package.json).
/* eslint-disable node/shebang */
import yargs from "yargs";
import UI from "console-ui";
import { homedir } from "os";
import { join } from "path";
const ui = new UI();
yargs
.scriptName("cardstack")
.command(
"start",
"Start the Cardstack environment",
args => {
return args.option("dir", {
alias: "d",
describe: "path to your local running cardstack",
type: "string",
default: join(homedir(), ".cardstack"),
});
},
async function(argv) {
let run = await import("../run");
constructor(options?: any) {
options = options || {};
this.ui = options.ui || new MockUI();
this.root = join(__dirname, '..', '..');
this.npmPackage = options.npmPackage || 'ember-cli';
this.instrumentation = options.instrumentation || new Instrumentation({});
this.packageInfoCache = new PackageInfoCache(this.ui);
}
}
'use strict';
const colors = require('colors');
const Table = require('cli-table');
const ConsoleUI = require('console-ui');
function UI() {
ConsoleUI.apply(this, arguments);
}
UI.prototype = Object.create(ConsoleUI.prototype);
Object.assign(UI.prototype, {
constructor: UI,
startProgress(message) {
return ConsoleUI.prototype.startProgress.call(this, message || '');
},
color(color, string) {
return colors[color](string);
},
createTable(options) {
return new Table(options);
}
});
startProgress(message) {
return ConsoleUI.prototype.startProgress.call(this, message || '');
},
function UI() {
ConsoleUI.apply(this, arguments);
}