This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { access, appendFile, mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
||||||
import type { Dirent } from "node:fs";
|
import type { Dirent } from "node:fs";
|
||||||
|
import { access, appendFile, mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
||||||
import { homedir } from "node:os";
|
import { homedir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,11 @@ function isGraph(value: unknown): boolean {
|
|||||||
*/
|
*/
|
||||||
export function workflowNameFromPath(filePath: string): string {
|
export function workflowNameFromPath(filePath: string): string {
|
||||||
const base = basename(filePath);
|
const base = basename(filePath);
|
||||||
const stem = base.endsWith(".yaml") ? base.slice(0, -5) : base.endsWith(".yml") ? base.slice(0, -4) : base;
|
const stem = base.endsWith(".yaml")
|
||||||
|
? base.slice(0, -5)
|
||||||
|
: base.endsWith(".yml")
|
||||||
|
? base.slice(0, -4)
|
||||||
|
: base;
|
||||||
if (stem === "index") {
|
if (stem === "index") {
|
||||||
return basename(dirname(filePath));
|
return basename(dirname(filePath));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user