diff options
author | EuAndreh <eu@euandre.org> | 2024-02-24 15:47:19 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-02-24 15:47:19 -0300 |
commit | d064f5ba5cc2fa592c0e7566560b05e9c4ed65dc (patch) | |
tree | fdc89ddd55c375e9a4ac7021375bfbaf48d2c0e7 /src/accretion.mjs | |
parent | src/hero.mjs: Add buildServer() (diff) | |
download | papod-d064f5ba5cc2fa592c0e7566560b05e9c4ed65dc.tar.gz papod-d064f5ba5cc2fa592c0e7566560b05e9c4ed65dc.tar.xz |
Normalize how modules import and name each other
Also add a `defaultInterceptors` variable in `src/hero.mjs` to avoid
needing to redefine it in every application.
Diffstat (limited to 'src/accretion.mjs')
-rw-r--r-- | src/accretion.mjs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/accretion.mjs b/src/accretion.mjs index 117e291..a9adb97 100644 --- a/src/accretion.mjs +++ b/src/accretion.mjs @@ -5,7 +5,7 @@ import url from "node:url"; import sqlite from "./sqlite.cjs"; -import { difference, log } from "./utils.mjs"; +import * as u from "./utils.mjs"; const DIRNAME = path.dirname(url.fileURLToPath(import.meta.url)); @@ -25,12 +25,12 @@ export const runMigrations = async db => { const done = [...(await db.all("SELECT filename FROM migrations;"))] .map(row => row.filename); const allFiles = fs.readdirSync(MIGRATIONS_DIR, "UTF-8"); - const pending = difference(new Set(allFiles), new Set(done)); + const pending = u.difference(new Set(allFiles), new Set(done)); const sortedPending = [...pending] .sort((a, b) => a.localeCompare(b, "POSIX")); for (const filename of sortedPending) { - log({ log: "exec-migration", filename }); + u.log({ log: "exec-migration", filename }); const sql = fs.readFileSync(MIGRATIONS_DIR + filename, "UTF-8"); await db.exec("BEGIN TRANSACTION;"); await db.exec(sql); |