diff --git a/scripts/load-env.ps1 b/scripts/load-env.ps1 index c85cf0b..64db2be 100644 --- a/scripts/load-env.ps1 +++ b/scripts/load-env.ps1 @@ -1,4 +1,7 @@ -get-content .env | foreach { - $name, $value = $_.split('=') +get-content .env | ForEach-Object { + $name, $value = $_.split('=', 2) + if ([string]::IsNullOrWhiteSpace($name) || $name.Contains('#')) { + continue + } set-content env:\$name $value } \ No newline at end of file diff --git a/scripts/update-snapshot.sh b/scripts/update-snapshot.sh new file mode 100755 index 0000000..91a45be --- /dev/null +++ b/scripts/update-snapshot.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# shellcheck disable=SC2046 +[ -f .env ] && export $(grep -v '^#' .env | xargs) + +pnpm install +pnpm run test -u diff --git a/src/__snapshots__/pixiv.test.ts.snap b/src/__snapshots__/pixiv.test.ts.snap index 3fa8f81..2477770 100644 --- a/src/__snapshots__/pixiv.test.ts.snap +++ b/src/__snapshots__/pixiv.test.ts.snap @@ -191,10 +191,6 @@ exports[`pixiv illustDetail:107565629[illust] 1`] = ` "name": "衣装チェンジ", "translated_name": null, }, - { - "name": "尊死", - "translated_name": null, - }, { "name": "Incredibly", "translated_name": null,