diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3948a65..dbbb3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - uses: denoland/setup-deno@v1 + with: + deno-version: rc + - name: lint if: matrix.os == 'macOS-latest' run: | @@ -34,3 +38,19 @@ jobs: if: matrix.os == 'windows-latest' shell: pwsh run: ./install_test.ps1 + + - name: deno lint + run: deno lint + + - name: check fmt + run: deno fmt --check + + - name: check bundled file up to date + run: | + cd shell-setup + deno task bundle + if ! git --no-pager diff --exit-code ./bundled.esm.js; then + echo 'Bundled script is out of date, update it with `cd shell-setup; deno task bundle`. + exit 1 + fi + diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..c13fa68 --- /dev/null +++ b/deno.json @@ -0,0 +1,15 @@ +{ + "workspace": [ + "./shell-setup" + ], + "lint": { + "exclude": [ + "./shell-setup/bundled.esm.js" + ] + }, + "fmt": { + "exclude": [ + "./shell-setup/bundled.esm.js" + ] + } +} diff --git a/shell-setup/src/main.ts b/shell-setup/src/main.ts index 9d15235..69084a6 100644 --- a/shell-setup/src/main.ts +++ b/shell-setup/src/main.ts @@ -162,8 +162,8 @@ async function updateRcFile( command: string | UpdateRcFile, backups: Backups, ): Promise { - let prepend: string = ""; - let append: string = ""; + let prepend = ""; + let append = ""; if (typeof command === "string") { append = command; } else {