dbmate
Version:
A lightweight, framework-agnostic database migration tool
26 lines • 813 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveBinary = resolveBinary;
const node_process_1 = require("node:process");
/**
* Resolve path to dbmate for the current platform
* */
function resolveBinary() {
const ext = node_process_1.platform === "win32" ? ".exe" : "";
const path = `@dbmate/${node_process_1.platform}-${node_process_1.arch}/bin/dbmate${ext}`;
try {
return require.resolve(path);
}
catch (err) {
if (err != undefined &&
typeof err === "object" &&
"code" in err &&
err.code === "MODULE_NOT_FOUND") {
throw new Error(`Unable to locate dbmate binary '${path}'`);
}
else {
throw err;
}
}
}
//# sourceMappingURL=resolveBinary.js.map