-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document minimal config files #1310
Conversation
03abdc6
to
fd6e939
Compare
I'm not sure I'd recommend set-env in our official docs when it's not officially a part of nushell yet. |
Yeah that's why I didn't imply it's standard in any way. Just makes a day 1 tricky task easier. I have no reservation about removing that block regardless! Pasting here in case we ever add it back: ::: tip
Try downloading the [`set-env`](https://github.com/nushell/nu_scripts/blob/main/stdlib-candidate/std-rfc/set-env.nu) command in order to _merge_ nested `$env` values at any depth:
```nu
set-env config.<field name> <field value>
```
You can optionally `--append` list settings such as [hooks](/book/hooks.md).
::: |
I'm fine with |
933c594
to
a8ec499
Compare
My bad fixed 🙉 |
d37efd3
to
b57b25e
Compare
@fdncred I added 2 infra lines to enable my live preview in the description: +const [ciUser, ciRepo] = process.env.GITHUB_REPOSITORY?.split('/') ?? []
export default defineUserConfig({
+ base: ciRepo && ciUser !== 'nushell' ? `/${ciRepo}/` : '/',
|
I'd guess this isn't a good idea because it's specific to your environment and no one else's. |
You can try it in your own fork by enabling actions there 💯 |
Are you saying this is a github thing or something specific to your env vars? |
95451ef
to
1ceea18
Compare
Added comments for maintenance: +// default env from the deploy GitHub action
+// e.g. ciUser = nushell and ciRepo = nushell.github.io
+// both default to undefined if the env is undefined
const [ciUser, ciRepo] = process.env.GITHUB_REPOSITORY?.split('/') ?? []
export default defineUserConfig({
+ // set the base URL to ciRepo dir if it's a fork
+ // keep the default root if not
base: ciRepo && ciUser !== 'nushell' ? `/${ciRepo}/` : '/', Also in ## Enabling a Preview URL From Your Fork
Just enable GitHub actions in your repo settings. That's all! It will start deploying the next time you push to `main`. |
ok, thanks |
3 New "Tips"
std path add
to simplify editing the system pathset-env
from nu_scripts to simplify editing nested configsAdditional Amendments:
env.nu
vsconfig.nu
upsert
is necessaryconfig.nu
not loading non-interactivelynuopen
command to alias$env.PATH
snippet more conventionally