UNPKG

@k14v/nlink

Version:

Modifies the global NodeJS module links to transpiled directory src -> lib

45 lines (44 loc) 1.43 kB
#!/usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const yargs_1 = __importDefault(require("yargs")); const path_1 = __importDefault(require("path")); const helpers_1 = require("yargs/helpers"); const ensureLinks_1 = __importDefault(require("./ensureLinks")); const logger_1 = __importDefault(require("./logger")); (async () => { const argv = await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)) .option('verbose', { alias: 'v', type: 'boolean', description: 'Run with verbose logging', }) .option('lib', { alias: 'l', type: 'string', description: 'Directory to bind' }) .option('cwd', { alias: 'c', type: 'string', description: 'Directory to where the modules is located' }) .option('no-workspace', { type: 'boolean', description: 'Apply links if workspace if present', }) .parse(); const cwd = argv.cwd ? path_1.default.resolve(argv.cwd) : process.cwd(); if (argv.verbose) { logger_1.default.enableVerbose(); } (0, ensureLinks_1.default)({ logger: logger_1.default, cwd, workspace: argv.workspace, lib: argv.lib }); })();