push
github
34 of 36 branches covered (94.44%)
Branch coverage included in aggregate %.
181 of 193 new or added lines in 3 files covered. (93.78%)
200 of 212 relevant lines covered (94.34%)
6.51 hits per line
|
import fs from "fs";
|
|
|
|
1✔ |
|
/**
|
1✔ |
|
* @param {string[]} args |
1✔ |
|
* @returns {Promise<void>} |
1✔ |
|
*/ |
1✔ |
|
export async function createBundle(args) {
|
|
|
if (args.length === 0) { |
1✔ |
|
console.error("Error: Migrations folder path expected as first argument");
|
1✔ |
|
return;
|
1✔ |
|
} |
1✔ |
NEW
|
|
|
NEW
|
const migrationsDir = args[0]; |
× |
NEW
|
try {
|
× |
NEW
|
if (!fs.lstatSync(migrationsDir).isDirectory()) {
|
× |
NEW
|
console.error(`"Error: ${migrationsDir}" is not a directory`); |
× |
NEW
|
return;
|
× |
NEW
|
} |
× |
|
} catch (_) {
|
|
NEW
|
console.error(`Error: Migrations folder "${migrationsDir}" doesn't exist`); |
× |
NEW
|
return;
|
× |
NEW
|
} |
× |
NEW
|
|
× |
NEW
|
console.log(`migrationsDir: "${migrationsDir}"`); |
× |
|
} |
1✔ |