Skip to content

Commit a9d4b1a

Browse files
authored
Merge pull request #16 from takker99/deno-udd
chore: upgrade modules and deno
2 parents f3fdf43 + 44ebd26 commit a9d4b1a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

.github/workflows/udd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: denoland/setup-deno@v1
1414
with:
15-
deno-version: 1.18.2
15+
deno-version: 1.21.0
1616
- name: Update dependencies
1717
run: >
18-
deno run --allow-net --allow-read=deps.ts --allow-write=deps.ts
18+
deno run --allow-net --allow-read --allow-write=deps.ts
1919
--allow-run=deno https://deno.land/x/udd@0.7.2/main.ts deps.ts
2020
- name: Create Pull Request
2121
uses: peter-evans/create-pull-request@v3

deps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import "https://deno.land/x/dotenv@v3.1.0/load.ts";
2-
export * from "https://pax.deno.dev/takker99/scrapbox-userscript-std@0.1.0/rest/page-data.ts";
3-
export { ensureString } from "https://deno.land/x/unknownutil@v1.1.4/mod.ts";
1+
import "https://deno.land/x/dotenv@v3.2.0/load.ts";
2+
export * from "https://raw.githubusercontent.com/takker99/scrapbox-userscript-std/0.14.1/rest/page-data.ts";
3+
export { assertString } from "https://deno.land/x/unknownutil@v2.0.0/mod.ts";

index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { ensureString, exportPages, importPages } from "./deps.ts";
1+
import { assertString, exportPages, importPages } from "./deps.ts";
22

33
const sid = Deno.env.get("SID");
44
const exportingProjectName = Deno.env.get("SOURCE_PROJECT_NAME"); //インポート元(本来はprivateプロジェクト)
55
const importingProjectName = Deno.env.get("DESTINATION_PROJECT_NAME"); //インポート先(publicプロジェクト)
66
const shouldDuplicateByDefault =
77
Deno.env.get("SHOULD_DUPLICATE_BY_DEFAULT") === "True";
88

9-
ensureString(sid);
10-
ensureString(exportingProjectName);
11-
ensureString(importingProjectName);
9+
assertString(sid);
10+
assertString(exportingProjectName);
11+
assertString(importingProjectName);
1212

1313
console.log(`Exporting a json file from "/${exportingProjectName}"...`);
1414
const result = await exportPages(exportingProjectName, {
@@ -17,11 +17,11 @@ const result = await exportPages(exportingProjectName, {
1717
});
1818
if (!result.ok) {
1919
const error = new Error();
20-
error.name = `${result.name} when exporting a json file`;
21-
error.message = result.message;
20+
error.name = `${result.value.name} when exporting a json file`;
21+
error.message = result.value.message;
2222
throw error;
2323
}
24-
const { pages } = result;
24+
const { pages } = result.value;
2525
console.log(`Export ${pages.length}pages:`);
2626
for (const page of pages) {
2727
console.log(`\t${page.title}`);
@@ -50,9 +50,9 @@ if (importingPages.length === 0) {
5050
});
5151
if (!result.ok) {
5252
const error = new Error();
53-
error.name = `${result.name} when importing pages`;
54-
error.message = result.message;
53+
error.name = `${result.value.name} when importing pages`;
54+
error.message = result.value.message;
5555
throw error;
5656
}
57-
console.log(result.message);
57+
console.log(result.value);
5858
}

runtime.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.17.1
1+
v1.21.0

0 commit comments

Comments
 (0)