Skip to content
16 changes: 9 additions & 7 deletions packages/create-gen-app-test/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Inquirerer, ListQuestion } from "inquirerer";
import minimist, { ParsedArgs } from "minimist";

import { CacheManager, GitCloner, checkNpmVersion } from "create-gen-app";
import { createFromTemplate } from './index';
import { createFromTemplate } from "./index";

const DEFAULT_REPO = "https://github.com/constructive-io/pgpm-boilerplates.git";
const DEFAULT_PATH = "default";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again this should be .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as above reply

Expand All @@ -18,7 +18,7 @@ const DEFAULT_TTL_DAYS = DEFAULT_TTL / (24 * 60 * 60 * 1000);

// Import package.json for version
import * as createGenPackageJson from "create-gen-app/package.json";
const PACKAGE_NAME = createGenPackageJson.name ?? "@constructive/cli";
const PACKAGE_NAME = createGenPackageJson.name ?? "@launchql/cli";
const PACKAGE_VERSION = createGenPackageJson.version ?? "0.0.0";

const RESERVED_ARG_KEYS = new Set([
Expand Down Expand Up @@ -134,7 +134,7 @@ export async function runCli(
console.warn(
`⚠️ Cached template expired (last updated: ${new Date(expiredMetadata.lastUpdated).toLocaleString()})`
);
console.log('Updating cache...');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdqede please use ' not " — you're changing things that make PRs hard to read, and also it's not our preferred style, please use '' (single quotes)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and @sdqede while you're working on this repo, can you also fix all the [email protected] and please change it to [email protected] thanks

console.log("Updating cache...");
cacheManager.clear(cacheKey);
}

Expand All @@ -150,7 +150,7 @@ export async function runCli(
gitCloner.clone(normalizedUrl, tempDest, { branch: args.branch, depth: 1 });
cacheManager.set(cacheKey, tempDest);
templateDir = tempDest;
console.log('Template cached for future runs');
console.log("Template cached for future runs");
}

try {
Expand Down Expand Up @@ -209,8 +209,8 @@ export async function runCli(
const answerOverrides = extractAnswerOverrides(args);
const noTty = Boolean(
args["no-tty"] ??
(args as Record<string, unknown>).noTty ??
(args as Record<string, unknown>).tty === false
(args as Record<string, unknown>).noTty ??
(args as Record<string, unknown>).tty === false
);

// Use the createFromTemplate function which will use the same cache
Expand Down Expand Up @@ -330,7 +330,9 @@ if (require.main === module) {
}

function resolveTtlOption(args: ParsedArgs): number | undefined {
const disableTtl = Boolean(args["no-ttl"] ?? (args as Record<string, unknown>).noTtl);
const disableTtl = Boolean(
args["no-ttl"] ?? (args as Record<string, unknown>).noTtl
);
if (disableTtl) {
return undefined;
}
Expand Down