mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
18 lines
521 B
TypeScript
18 lines
521 B
TypeScript
/* eslint-disable */
|
|
import { execSync } from "child_process";
|
|
import { readdirSync } from "fs";
|
|
import path from "path";
|
|
import promptSync from "prompt-sync";
|
|
|
|
const prompt = promptSync({ sigint: true });
|
|
|
|
const migrationName = prompt("Enter name for seedfile: ");
|
|
const fileCounter = readdirSync(path.join(__dirname, "../src/db/seed")).length || 1;
|
|
execSync(
|
|
`npx knex seed:make --knexfile ${path.join(
|
|
__dirname,
|
|
"../src/db/knexfile.ts"
|
|
)} -x ts ${fileCounter}-${migrationName}`,
|
|
{ stdio: "inherit" }
|
|
);
|