Skip to content

Commit 2c8ae45

Browse files
authored
log globbed
1 parent 60221e0 commit 2c8ae45

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

main.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ import { $ } from "npm:zx";
44
import process from "node:process";
55
import { temporaryDirectory, temporaryWrite } from "npm:tempy";
66
import { join } from "node:path";
7-
import * as core from "npm:@actions/core"
8-
import { glob } from "npm:glob"
7+
import * as core from "npm:@actions/core";
8+
import { glob } from "npm:glob";
99

10-
let path = core.getInput("path")
10+
let path = core.getInput("path");
1111
if ((await lstat(path)).isDirectory()) {
12-
console.log("original path")
13-
const pattern = join(path, "[Rr][Ee][Aa][Dd][Mm][Ee].{md,mdown,markdown}")
14-
console.log("glob pattern", pattern)
15-
[path] = await glob(pattern)
12+
console.log("original path");
13+
const pattern = join(path, "[Rr][Ee][Aa][Dd][Mm][Ee].{md,mdown,markdown}");
14+
console.log("glob pattern", pattern);
15+
const globbed = await glob(pattern);
16+
console.log("glob result", globbed);
17+
path = globbed[0];
1618
}
17-
console.log("resolved path", path)
19+
console.log("resolved path", path);
1820

19-
let collection = core.getInput("collection")
21+
let collection = core.getInput("collection");
2022
if (!collection.includes(":")) {
21-
collection += ":latest"
23+
collection += ":latest";
2224
}
23-
console.log("resolved collection", collection)
25+
console.log("resolved collection", collection);
2426

2527
let md = await readFile(path, "utf8");
2628

@@ -31,14 +33,14 @@ await $`oras pull ${collection}`;
3133
const devcontainerCollection = JSON.parse(
3234
await readFile(join($.cwd, "devcontainer-collection.json"), "utf8")
3335
);
34-
console.log(devcontainerCollection)
36+
console.log(devcontainerCollection);
3537

3638
if (devcontainerCollection.features) {
3739
const featureListMD = devcontainerCollection.features
3840
.filter((f) => f.documentationURL)
3941
.map((f) => `- **[${f.name}](${f.documentationURL})** - ${f.description}`)
4042
.join("\n");
41-
console.log(featureListMD)
43+
console.log(featureListMD);
4244

4345
md = md.replace(
4446
/(<!-- START_FEATURE_LIST -->)([\s\S]*?)(<!-- END_FEATURE_LIST -->)/,
@@ -51,7 +53,7 @@ if (devcontainerCollection.templates) {
5153
.filter((f) => f.documentationURL)
5254
.map((f) => `- **[${f.name}](${f.documentationURL})** - ${f.description}`)
5355
.join("\n");
54-
console.log(templateListMD)
56+
console.log(templateListMD);
5557

5658
md = md.replace(
5759
/(<!-- START_TEMPLATE_LIST -->)([\s\S]*?)(<!-- END_TEMPLATE_LIST -->)/,

0 commit comments

Comments
 (0)