-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eec9d5
commit ffcbbd8
Showing
5 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
os: [windows-latest] | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
|
@@ -35,4 +35,20 @@ jobs: | |
npm ci | ||
npx playwright install --with-deps | ||
npm run format package.json | ||
npm run test:all | ||
- name: compile | ||
run: npm run compile | ||
- name: mono-vir-test | ||
run: | | ||
npx mono-vir for-each-async echo bye | ||
- name: coverage | ||
run: npm run test:coverage | ||
- name: spelling | ||
run: npm run test:spelling | ||
- name: format | ||
run: npm run test:format | ||
- name: docs | ||
run: npm run test:docs | ||
- name: deps | ||
run: npm run test:deps | ||
- name: lint | ||
run: npm run test:lint |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {assert} from '@augment-vir/assert'; | ||
import {log, type MaybePromise} from '@augment-vir/common'; | ||
import {existsSync} from 'fs'; | ||
import {readFile, writeFile} from 'fs/promises'; | ||
import {dirname, resolve} from 'path'; | ||
|
||
const monoVirPackageJsonPath = resolve( | ||
import.meta.dirname, | ||
'..', | ||
'..', | ||
'..', | ||
'node_modules', | ||
'mono-vir', | ||
'package.json', | ||
); | ||
|
||
const monoVirBinFile = resolve(dirname(monoVirPackageJsonPath), 'bin.sh'); | ||
|
||
await fixContents(monoVirPackageJsonPath, (original) => | ||
original.replace('"./bin.sh"', '"bash bin.sh"'), | ||
); | ||
|
||
await fixContents(monoVirBinFile, (original) => original.replace('npx', 'echo "hi";\nnpx')); | ||
|
||
log.success('overwrote mono-vir bin'); | ||
|
||
async function fixContents( | ||
filePath: string, | ||
fixCallback: (original: string) => MaybePromise<string>, | ||
) { | ||
assert(existsSync(filePath)); | ||
|
||
const original = String(await readFile(filePath)); | ||
|
||
const fixed = await fixCallback(original); | ||
|
||
await writeFile(filePath, fixed); | ||
} |