Skip to content

Commit 691e6cb

Browse files
authored
Merge pull request #522 from google/dev
v7.1.0
2 parents 0a2cf6c + d6ee524 commit 691e6cb

19 files changed

Lines changed: 935 additions & 548 deletions

.github/workflows/dev-publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dev Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
- run: npm i
17+
- run: npm test
18+
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
19+
env:
20+
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
21+
- run: |
22+
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
23+
npm publish --no-git-tag-version --tag dev

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,33 @@ Evaluate the following argument as a script.
509509
cat package.json | zx --eval 'let v = JSON.parse(await stdin()).version; echo(v)'
510510
```
511511

512+
### Installing dependencies via --install
513+
514+
```js
515+
// script.mjs:
516+
import sh from 'tinysh'
517+
sh.say('Hello, world!')
518+
```
519+
520+
Add `--install` flag to the `zx` command to install missing dependencies
521+
automatically.
522+
523+
```bash
524+
zx --install script.mjs
525+
```
526+
527+
You can also specify needed version by adding comment with `@` after
528+
the import.
529+
530+
```js
531+
import sh from 'tinysh' // @^1
532+
```
533+
512534
### Attaching a profile
513535

514536
By default `child_process` does not include aliases and bash functions.
515-
But you are still able to do it by hand. Just attach necessary directives to `$.prefix`.
537+
But you are still able to do it by hand. Just attach necessary directives
538+
to the `$.prefix`.
516539

517540
```js
518541
$.prefix += 'export NVM_DIR=$HOME/.nvm; source $NVM_DIR/nvm.sh; '

docs/quotes.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,3 @@ Use `glob` function and `os` package:
7373
let files = await glob(os.homedir() + '/dev/**/*.md')
7474
await $`ls ${files}`
7575
```
76-
77-

0 commit comments

Comments
 (0)