Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
fix: terminal width and consistent yarn or npm usage
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzwa committed Oct 30, 2023
1 parent 9994e63 commit 95264d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "David Zwart",
"license": "AGPL-3.0-or-later",
"private": false,
"version": "0.1.2-alpha",
"version": "0.1.3-alpha",
"bin": {
"fdm-monster": "dist/cli.js",
"fdmm": "dist/cli.js"
Expand Down
6 changes: 4 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { fetchPackageVersions, getInstalledVersionSafe, getTagOrLatest } from "@

const cliCmd = "fdmm";
const packageName = "@fdm-monster/server";
const cliVersion = "0.1.0-alpha";
const cliVersion = require("../package.json").version;

yargs(hideBin(process.argv))
.usage(`Usage: $0 install`)
Expand All @@ -26,6 +26,7 @@ yargs(hideBin(process.argv))
.option("npm", {
alias: "n",
boolean: true,
default: false,
description: "Fall back to npm instead of yarn",
})
.option("cwd", {
Expand All @@ -48,7 +49,7 @@ yargs(hideBin(process.argv))
() => {},
async (opts) => {
const workspaceFolder = getWorkspaceFolder(opts.cwd);
const tag = getTagOrLatest(workspaceFolder, packageName, opts.tag);
const tag = getTagOrLatest(workspaceFolder, packageName, opts.tag, !!opts.npm);
const packageSpecifier = `${packageName}@${tag}`;
console.log(`Installing "${packageSpecifier}"`);
runPackageInstall(workspaceFolder, packageSpecifier, !!opts.npm);
Expand Down Expand Up @@ -113,6 +114,7 @@ yargs(hideBin(process.argv))
.alias("h", "help")
.version("version", cliVersion) // the version string.
.alias("version", "v")
.wrap(yargs.terminalWidth())
.epilog("For more information visit https://fdm-monster.net\nCopyright 2023 D. J. Zwart - AGPLv3 License").argv;

function prepareServiceInstaller(cwd: string, installServiceInstallerIfMissing: boolean = true, useNpmInstead: boolean = false) {
Expand Down

0 comments on commit 95264d2

Please sign in to comment.