@chronoter/main 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import ignore from 'ignore';
|
|
|
3
3
|
import * as fs from 'fs/promises';
|
|
4
4
|
import { readFile } from 'fs/promises';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
-
import { dirname, resolve, join, relative, extname,
|
|
6
|
+
import { dirname, basename, normalize, resolve, join, relative, extname, sep } from 'path';
|
|
7
7
|
import { visit } from 'unist-util-visit';
|
|
8
8
|
import { compile } from '@mdx-js/mdx';
|
|
9
9
|
import matter from 'gray-matter';
|
|
@@ -1610,7 +1610,7 @@ var runVersionCheck = async (packageName, currentVersion) => {
|
|
|
1610
1610
|
|
|
1611
1611
|
// src/cli/index.ts
|
|
1612
1612
|
var PACKAGE_NAME = "chronoter";
|
|
1613
|
-
var CURRENT_VERSION = "0.1.
|
|
1613
|
+
var CURRENT_VERSION = "0.1.6";
|
|
1614
1614
|
var createCliProgram = () => {
|
|
1615
1615
|
const program = new Command();
|
|
1616
1616
|
program.name("chronoter").description("Chronoter - MDX-based documentation site generator").version(CURRENT_VERSION);
|
|
@@ -1668,8 +1668,12 @@ var main = async () => {
|
|
|
1668
1668
|
}
|
|
1669
1669
|
await program.parseAsync(process.argv);
|
|
1670
1670
|
};
|
|
1671
|
-
var
|
|
1672
|
-
|
|
1671
|
+
var currentFilePath = fileURLToPath(import.meta.url);
|
|
1672
|
+
var executedFilePath = process.argv[1];
|
|
1673
|
+
var executedBase = executedFilePath ? basename(normalize(executedFilePath)) : void 0;
|
|
1674
|
+
var isDirectRun = executedFilePath === currentFilePath || executedBase === "chronoter" || executedBase === "chronoter-main";
|
|
1675
|
+
var isTestEnvironment = process.env.VITEST === "true" || process.env.NODE_ENV === "test";
|
|
1676
|
+
if (isDirectRun && !isTestEnvironment) {
|
|
1673
1677
|
main().catch((error) => {
|
|
1674
1678
|
console.error(chalk2.red("An unexpected error occurred:"));
|
|
1675
1679
|
console.error(error);
|