@dotdotdash/afterhours 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2900,7 +2900,8 @@ function registerReport(program) {
|
|
|
2900
2900
|
|
|
2901
2901
|
// src/cli/init.ts
|
|
2902
2902
|
import { existsSync as existsSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync2, mkdirSync, appendFileSync } from "fs";
|
|
2903
|
-
import { join as join6 } from "path";
|
|
2903
|
+
import { join as join6, dirname as dirname2 } from "path";
|
|
2904
|
+
import { fileURLToPath } from "url";
|
|
2904
2905
|
function registerInit(program) {
|
|
2905
2906
|
program.command("init").description("Scaffold afterhours config and an optional scheduler adapter in this repo").option("--force", "Overwrite existing .afterhours/config.yml").option("--scheduler <type>", "Scheduler adapter to install: github | docker-cron | none", "none").action(async (opts) => {
|
|
2906
2907
|
const cwd = process.cwd();
|
|
@@ -2968,8 +2969,9 @@ ${line}`);
|
|
|
2968
2969
|
});
|
|
2969
2970
|
}
|
|
2970
2971
|
function getTemplateDir() {
|
|
2972
|
+
const moduleDir = dirname2(fileURLToPath(import.meta.url));
|
|
2971
2973
|
const candidates = [
|
|
2972
|
-
join6(
|
|
2974
|
+
join6(moduleDir, "..", "templates"),
|
|
2973
2975
|
join6(process.cwd(), "templates")
|
|
2974
2976
|
];
|
|
2975
2977
|
for (const c of candidates) {
|
|
@@ -2981,7 +2983,7 @@ function getTemplateDir() {
|
|
|
2981
2983
|
// src/cli/main.ts
|
|
2982
2984
|
function main() {
|
|
2983
2985
|
const program = new Command();
|
|
2984
|
-
program.name("afterhours").description("afterhours CLI").version("0.1.
|
|
2986
|
+
program.name("afterhours").description("afterhours CLI").version("0.1.2");
|
|
2985
2987
|
registerInit(program);
|
|
2986
2988
|
registerRun(program);
|
|
2987
2989
|
program.command("audit").action(() => console.log("<audit>: not implemented yet"));
|