Skip to content

Commit

Permalink
Merge pull request #522 from google/dev
Browse files Browse the repository at this point in the history
v7.1.0
  • Loading branch information
antonmedv committed Oct 5, 2022
2 parents 0a2cf6c + d6ee524 commit 691e6cb
Show file tree
Hide file tree
Showing 19 changed files with 935 additions and 548 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Dev Publish

on:
push:
branches:
- dev

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm i
- run: npm test
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
env:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
- run: |
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
npm publish --no-git-tag-version --tag dev
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,33 @@ Evaluate the following argument as a script.
cat package.json | zx --eval 'let v = JSON.parse(await stdin()).version; echo(v)'
```

### Installing dependencies via --install

```js
// script.mjs:
import sh from 'tinysh'
sh.say('Hello, world!')
```

Add `--install` flag to the `zx` command to install missing dependencies
automatically.

```bash
zx --install script.mjs
```

You can also specify needed version by adding comment with `@` after
the import.

```js
import sh from 'tinysh' // @^1
```

### Attaching a profile

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

```js
$.prefix += 'export NVM_DIR=$HOME/.nvm; source $NVM_DIR/nvm.sh; '
Expand Down
2 changes: 0 additions & 2 deletions docs/quotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,3 @@ Use `glob` function and `os` package:
let files = await glob(os.homedir() + '/dev/**/*.md')
await $`ls ${files}`
```


0 comments on commit 691e6cb

Please sign in to comment.