Skip to content

Commit

Permalink
Import std/log environment; CI: Update Ubuntu (#103)
Browse files Browse the repository at this point in the history
Will fix [this issue](nushell/nushell#14109)
but its not a good fix anyway

## Description

This is a hotfix PR to address an unusual issue with the `std log`
package in Nushell. When the log is imported during the initialization
stage, it doesn’t persist long enough to be fully available at runtime,
specifically, the environment variables seem to disappear, although the
log function itself remains accessible. This is a temporary fix and
might not be the final solution. It could potentially be a bug in
Nushell, but unfortunately, I don't have the time to investigate it
further.

for more information please check [this
issue](nushell/nushell#14109)

I think this fix changes the output of the nupm, Plz close this PR if
you found any real solution
  • Loading branch information
FMotalleb authored Oct 24, 2024
1 parent 42d65a9 commit 5ce8940
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: true
matrix:
platform: [windows-latest, macos-latest, ubuntu-20.04]
platform: [windows-latest, macos-latest, ubuntu-24.04]

runs-on: ${{ matrix.platform }}

Expand Down
2 changes: 0 additions & 2 deletions nupm/install.nu
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std log

use utils/completions.nu complete-registries
use utils/dirs.nu [ nupm-home-prompt cache-dir module-dir script-dir tmp-dir ]
use utils/log.nu throw-error
Expand Down
4 changes: 4 additions & 0 deletions nupm/mod.nu
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std/log

use utils/dirs.nu [
DEFAULT_NUPM_HOME DEFAULT_NUPM_TEMP DEFAULT_NUPM_CACHE
DEFAULT_NUPM_REGISTRIES nupm-home-prompt
Expand Down Expand Up @@ -26,6 +28,8 @@ export-env {
# TODO: Add `nupm registry add/remove` to add/remove registry from the env?
$env.NUPM_REGISTRIES = ($env.NUPM_REGISTRIES?
| default $DEFAULT_NUPM_REGISTRIES)

use std/log []
}

# Nushell Package Manager
Expand Down

0 comments on commit 5ce8940

Please sign in to comment.