make --version print rome version
MODIFY
packages/@romejs/cli/cli.ts
packages/@romejs/cli/cli.ts
@@ -16,6 +16,7 @@ import {
localCommands,
} from '@romejs/core';
import setProcessTitle from './utils/setProcessTitle';
+import {VERSION} from "./utils/getRomeVersion";
import {parseCLIFlagsFromProcess} from '@romejs/cli-flags';
import {
createAbsoluteFilePath,
@@ -51,10 +52,10 @@ type CLIFlags = {
export default async function cli() {
setProcessTitle('cli');
-
const p = parseCLIFlagsFromProcess({
programName: 'rome',
usage: '[command] [flags]',
+ version: `v${VERSION}`,
defineFlags(c: Consumer): {
cliFlags: CLIFlags;
clientFlags: ClientFlags;
@@ -324,7 +325,6 @@ export default async function cli() {
// We don't use the data result, so no point transporting it over the bridge
noData: true,
});
-
await client.end();
if (res.type === 'SUCCESS') {

ADD
packages/@romejs/cli/utils/getRomeVersion.ts
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import packageJson from "../../../../package.json";
+
+export const VERSION = String(packageJson.version);
\ No newline at end of file

make --version print rome version