Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ jobs:
pkgx -Q node git | grep -q nodejs.org
! pkgx -Q git-scm.org@99999

- name: test PKGX_NO_INSTALL
run: |
rm -r ~/.pkgx/stedolan.github.io/jq || true
! PKGX_NO_INSTALL=1 pkgx jq --version
pkgx jq --version
PKGX_NO_INSTALL=1 pkgx jq --version

- run: if [ $(find ~/.pkgx -name .tmp\* -type d | wc -l) -gt 0 ]; then
exit 1;
fi
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "pkgx"
description = "Run anything"
authors = ["Max Howell <mxcl@me.com>", "Jacob Heider <jacob@pkgx.dev>"]
license = "Apache-2.0"
version = "2.8.0"
version = "2.9.0"
edition = "2021"
repository = "https://github.com/pkgxdev/pkgx"

Expand Down
5 changes: 5 additions & 0 deletions crates/cli/src/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::env;

use libpkgx::{
config::Config,
hydrate::hydrate,
Expand Down Expand Up @@ -84,6 +86,9 @@ pub async fn resolve(

let mut installations = resolution.installed;
if !resolution.pending.is_empty() {
if env::var("PKGX_NO_INSTALL").is_ok() {
return Err("PKGX_NO_INSTALL is set, refusing to install pending packages")?;
}
let installed = install_multi(&resolution.pending, config, spinner.arc()).await?;
installations.extend(installed);
}
Expand Down