fix inconsistent flag behaviour

This commit is contained in:
Aman Varshney
2025-02-13 17:52:50 +05:30
parent 50e336cfcb
commit 8245d18528
5 changed files with 46 additions and 28 deletions

View File

@@ -1,11 +1,9 @@
import chalk from "chalk";
import { DEFAULT_CONFIG } from "../consts";
import type { ProjectConfig } from "../types";
import { getUserPkgManager } from "./get-package-manager";
export function generateReproducibleCommand(config: ProjectConfig): string {
const flags: string[] = [];
const defaultPackageManager = getUserPkgManager();
if (config.database !== DEFAULT_CONFIG.database) {
flags.push(chalk.cyan(`--database ${config.database}`));
@@ -15,9 +13,13 @@ export function generateReproducibleCommand(config: ProjectConfig): string {
flags.push(chalk.yellow("--no-auth"));
}
if (!config.git) {
flags.push(chalk.red("--no-git"));
}
if (
config.packageManager &&
config.packageManager !== defaultPackageManager
config.packageManager !== DEFAULT_CONFIG.packageManager
) {
flags.push(chalk.magenta(`--package-manager ${config.packageManager}`));
}