Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deno subcmd
Browse files Browse the repository at this point in the history
Yohe-Am committed Dec 5, 2024
1 parent ac4a991 commit e49fef5
Showing 18 changed files with 991 additions and 906 deletions.
321 changes: 94 additions & 227 deletions .ghjk/deno.lock

Large diffs are not rendered by default.

51 changes: 32 additions & 19 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
@@ -269,7 +269,7 @@
"bciqe72molvtvcuj3tuh47ziue2oqd6t4qetxn3rsoa764ofup6uwjmi",
"bciqe4zlekl4uqqbhxunac7br24mrf6cdpfrfblahqa4vrgaqjujcl4i",
"bciqpu4klxr3hl6ujhmflrlfd3dxp47ijq26mnathb26ojzwkeggy5ii",
"bciqpy7sxlin5fqcbsl7vildckib5p65mei4qxya2fsbgvi2pqt3jimq"
"bciqelae2kzmf7umbo62flzq2mnlhnc4ilbfmn4va2fzrqwx7w7zusji"
],
"allowedBuildDeps": "bciqoo3t36t4pphdox5wa5ugn34wkar7rwkqgb5l55lwnxbuabcc3nyq"
},
@@ -281,7 +281,7 @@
"bciqe72molvtvcuj3tuh47ziue2oqd6t4qetxn3rsoa764ofup6uwjmi",
"bciqe4zlekl4uqqbhxunac7br24mrf6cdpfrfblahqa4vrgaqjujcl4i",
"bciqpu4klxr3hl6ujhmflrlfd3dxp47ijq26mnathb26ojzwkeggy5ii",
"bciqpy7sxlin5fqcbsl7vildckib5p65mei4qxya2fsbgvi2pqt3jimq"
"bciqelae2kzmf7umbo62flzq2mnlhnc4ilbfmn4va2fzrqwx7w7zusji"
],
"allowedBuildDeps": "bciqoo3t36t4pphdox5wa5ugn34wkar7rwkqgb5l55lwnxbuabcc3nyq"
},
@@ -294,9 +294,13 @@
"bciqe72molvtvcuj3tuh47ziue2oqd6t4qetxn3rsoa764ofup6uwjmi",
"bciqe4zlekl4uqqbhxunac7br24mrf6cdpfrfblahqa4vrgaqjujcl4i",
"bciqpu4klxr3hl6ujhmflrlfd3dxp47ijq26mnathb26ojzwkeggy5ii",
"bciqpy7sxlin5fqcbsl7vildckib5p65mei4qxya2fsbgvi2pqt3jimq"
"bciqelae2kzmf7umbo62flzq2mnlhnc4ilbfmn4va2fzrqwx7w7zusji"
],
"allowedBuildDeps": "bciqoo3t36t4pphdox5wa5ugn34wkar7rwkqgb5l55lwnxbuabcc3nyq"
},
"ghjkEnvProvInstSet_______task_env_cache-v8": {
"installs": [],
"allowedBuildDeps": "bciqeie3punk3gz4kcfdk2fxx5bsj5fh3j7bb7z36qmimayhwdsvp7cq"
}
}
}
@@ -308,13 +312,13 @@
"lock-sed": {
"ty": "denoFile@v1",
"key": "lock-sed",
"envKey": "bciqpstuhgkq5ne5uv4wobyf2houlb2leq5uvhevfmkr7rqudwro2f6i"
"envKey": "bciqcjjccn4eivzzybioty5p5tde6gnafea43rypzxci54tqjfglxyyy"
},
"cache-v8": {
"ty": "denoFile@v1",
"key": "cache-v8",
"desc": "Install the V8 builds to a local cache.",
"envKey": "bciqksijm3dibc72cqwbp7e6chayqnuhvpzj24ev6zzsjhn3bmt6copq"
"envKey": "bciqngtgh6vxbmug3jgfhtc6t2o7d4375gzfwxca2hmq2mhwbe4tajvq"
}
},
"tasksNamed": [
@@ -327,52 +331,60 @@
"id": "envs",
"config": {
"envs": {
"bciqjpw6xgc3ajnko2ymjuapnthfzgifz4yacuw62zjx4t6w2ya55mda": {
"bciqngtgh6vxbmug3jgfhtc6t2o7d4375gzfwxca2hmq2mhwbe4tajvq": {
"provides": [
{
"ty": "ghjk.ports.InstallSetRef",
"setId": "ghjkEnvProvInstSet_______task_env_cache-v8"
}
]
},
"bciqkjh3l5pvnydjxc3gp6autcaurxvw2euj7uz472qureg3p4y5nfuq": {
"desc": "the default default environment.",
"provides": [
{
"ty": "posix.envVar",
"key": "RUST_LOG",
"val": "debug,deno=info,denort=trace,swc_ecma_transforms_base=info"
"val": "info,deno=info,denort=trace,swc_ecma_transforms_base=info"
},
{
"ty": "ghjk.ports.InstallSetRef",
"setId": "ghjkEnvProvInstSet___main"
}
]
},
"bciqpstuhgkq5ne5uv4wobyf2houlb2leq5uvhevfmkr7rqudwro2f6i": {
"bciqcjjccn4eivzzybioty5p5tde6gnafea43rypzxci54tqjfglxyyy": {
"provides": [
{
"ty": "posix.envVar",
"key": "RUST_LOG",
"val": "debug,deno=info,denort=trace,swc_ecma_transforms_base=info"
"val": "info,deno=info,denort=trace,swc_ecma_transforms_base=info"
},
{
"ty": "ghjk.ports.InstallSetRef",
"setId": "ghjkEnvProvInstSet___main"
}
]
},
"bciqksijm3dibc72cqwbp7e6chayqnuhvpzj24ev6zzsjhn3bmt6copq": {
"bciqothoegu7lnencjdk6pjtassehqlzaldan6l67lmtd2slhmvnq5la": {
"provides": [
{
"ty": "posix.envVar",
"key": "RUST_LOG",
"val": "debug,deno=info,denort=trace,swc_ecma_transforms_base=info"
"val": "info,deno=info,denort=trace,swc_ecma_transforms_base=info"
},
{
"ty": "ghjk.ports.InstallSetRef",
"setId": "ghjkEnvProvInstSet____rust"
}
]
},
"bciqh3i5r22rdn63dpluzbp7buhz5ko2jsyarp3nlet2kqzypdfpmlqi": {
"bciqdlbved4xvo27dss37motxje63ai3mwc4g5otjre5heqto2g7zbhi": {
"provides": [
{
"ty": "posix.envVar",
"key": "RUST_LOG",
"val": "debug,deno=info,denort=trace,swc_ecma_transforms_base=info"
"val": "info,deno=info,denort=trace,swc_ecma_transforms_base=info"
},
{
"ty": "posix.envVar",
@@ -388,9 +400,9 @@
},
"defaultEnv": "dev",
"envsNamed": {
"main": "bciqjpw6xgc3ajnko2ymjuapnthfzgifz4yacuw62zjx4t6w2ya55mda",
"_rust": "bciqksijm3dibc72cqwbp7e6chayqnuhvpzj24ev6zzsjhn3bmt6copq",
"dev": "bciqh3i5r22rdn63dpluzbp7buhz5ko2jsyarp3nlet2kqzypdfpmlqi"
"main": "bciqkjh3l5pvnydjxc3gp6autcaurxvw2euj7uz472qureg3p4y5nfuq",
"_rust": "bciqothoegu7lnencjdk6pjtassehqlzaldan6l67lmtd2slhmvnq5la",
"dev": "bciqdlbved4xvo27dss37motxje63ai3mwc4g5otjre5heqto2g7zbhi"
}
}
}
@@ -480,8 +492,8 @@
},
"packageName": "vale"
},
"bciqpy7sxlin5fqcbsl7vildckib5p65mei4qxya2fsbgvi2pqt3jimq": {
"version": "2.0.6",
"bciqelae2kzmf7umbo62flzq2mnlhnc4ilbfmn4va2fzrqwx7w7zusji": {
"version": "2.1.2",
"port": {
"ty": "denoWorker@v1",
"name": "deno_ghrel",
@@ -910,7 +922,8 @@
"moduleSpecifier": "file:///ports/mold.ts"
},
"replaceLd": true
}
},
"bciqeie3punk3gz4kcfdk2fxx5bsj5fh3j7bb7z36qmimayhwdsvp7cq": {}
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ on:
workflow_dispatch:

env:
DENO_VERSION: "2.0.6"
DENO_VERSION: "2.1.2"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GHJK_LOG_PANIC_LEVEL: error
DENO_DIR: .deno-dir
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ on:
- ready_for_review

env:
DENO_VERSION: "2.0.6"
DENO_VERSION: "2.1.2"
GHJK_LOG: debug
GHJK_LOG_PANIC_LEVEL: error
DENO_DIR: .deno-dir
930 changes: 703 additions & 227 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ edition = "2021"

[workspace.dependencies]
denort = { path = "src/denort" }
deno = { git = "https://github.com/metatypedev/deno", branch = "v2.0.6-embeddable" }
deno = { git = "https://github.com/metatypedev/deno", branch = "v2.1.2-embeddable" }
# needed to get deno_core::op2 working
# must track version used by deno
deno_core = "=0.318.0"
# WARN: must track version used by deno
deno_core = "=0.323.0"

educe = "0.6"

@@ -28,7 +28,7 @@ tracing-unwrap = "1.0"

once_cell = "1"

# version must match on clap in `deno`
# WARN: version must match on clap in `deno`
clap = "=4.5"
clap_complete = "=4.5.24"

2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tasks": {
"test": "cargo x test tests/*",
"test": "cargo build -p ghjk && deno test --parallel --unstable-worker-options --unstable-kv -A tests/*",
"self": "deno run -A --unstable-kv --unstable-worker-options main.ts ",
"cache": "deno cache deps/*",
"check": "deno run -A ./scripts/check.ts",
369 changes: 2 additions & 367 deletions deno.lock

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions ghjk.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ config({
});

env("main").vars({
RUST_LOG: "debug,deno=info,denort=trace,swc_ecma_transforms_base=info",
RUST_LOG: "info,deno=info,denort=trace,swc_ecma_transforms_base=info",
});

env("_rust")
@@ -50,7 +50,7 @@ if (Deno.build.os == "linux" && !Deno.env.has("NO_MOLD")) {
// these are just for quick testing
install();

const DENO_VERSION = "2.0.6";
const DENO_VERSION = "2.1.2";

// these are used for developing ghjk
install(
@@ -126,6 +126,12 @@ task(
[/(GHJK_VERSION="\$\{GHJK_VERSION:-v).*(\}")/, GHJK_VERSION],
[/(DENO_VERSION="\$\{DENO_VERSION:-v).*(\}")/, DENO_VERSION],
],
"./tests/test.Dockerfile": [
[/(ARG DENO_VERSION=).*()/, DENO_VERSION],
],
"./tests/test-alpine.Dockerfile": [
[/(ARG DENO_VERSION=).*()/, DENO_VERSION],
],
"./docs/*.md": [
[
/(.*\/metatypedev\/ghjk\/v)[^/]*(\/.*)/,
@@ -142,6 +148,13 @@ task(
GHJK_VERSION,
],
],
"**/Cargo.toml": [
[/^(version = ").+(")/, GHJK_VERSION],
[
/(deno\s*=\s*\{\s*git\s*=\s*"https:\/\/github\.com\/metatypedev\/deno"\s*,\s*branch\s*=\s*"v).+(-embeddable"\s*\})/,
DENO_VERSION,
],
],
},
ignores: [
// ignore this file to avoid hits on the regexps
@@ -162,4 +175,5 @@ task(
},
);
},
{ inherits:false }
);
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ set -e -u
GHJK_VERSION="${GHJK_VERSION:-v0.3.0}"
GHJK_INSTALLER_URL="${GHJK_INSTALLER_URL:-https://raw.github.com/metatypedev/ghjk/$GHJK_VERSION/install.ts}"
GHJK_SHARE_DIR="${GHJK_SHARE_DIR:-$HOME/.local/share/ghjk}"
DENO_VERSION="${DENO_VERSION:-v2.0.6}"
DENO_VERSION="${DENO_VERSION:-v2.1.2}"

# make sure the version is prepended with v
if [ "${DENO_VERSION#"v"}" = "$DENO_VERSION" ]; then
32 changes: 3 additions & 29 deletions install/mod.ts
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ const getHooksVfs = async () => ({
"env.bash": [
"# importing bash-preexec, see the ghjk hook at then end\n\n",
await importRaw(
"https://raw.githubusercontent.com/rcaloras/bash-preexec/0.5.0/bash-preexec.sh",
import.meta.resolve("./bash-preexec.sh"),
),
await importRaw(import.meta.resolve("./hook.sh")),
].join("\n"),
@@ -105,50 +105,24 @@ async function filterAddContent(
interface InstallArgs {
homeDir: string;
ghjkShareDir: string;
ghjkConfigDir: string;
shellsToHook?: string[];
/** The mark used when adding the hook to the user's shell rcs.
* Override to allow multiple hooks in your rc.
*/
shellHookMarker: string;
/**
* The ghjk bin is optional, one can always invoke it
* using `deno run --flags uri/to/ghjk/main.ts`;
*/
skipExecInstall: boolean;
/** The directory in which to install the ghjk exec
* Preferrably, one that's in PATH
*/
ghjkExecInstallDir: string;
/**
* The deno exec to be used by the ghjk executable
* by default will be "deno" i.e. whatever in $PATH that resolves that to.
*/
ghjkExecDenoExec: string;
/**
* The cache dir to use by the ghjk deno installation.
*/
ghjkDenoCacheDir?: string;
/**
* Disable using a lockfile for the ghjk command
*/
noLockfile: boolean;
}

export const defaultInstallArgs: InstallArgs = {
ghjkShareDir: $.path(dirs().shareDir).resolve("ghjk").toString(),
homeDir: dirs().homeDir,
shellsToHook: [],
shellHookMarker: "ghjk-hook-default",
skipExecInstall: true,
// TODO: respect xdg dirs
ghjkExecInstallDir: $.path(dirs().homeDir).resolve(".local", "bin")
.toString(),
ghjkExecDenoExec: Deno.execPath(),
/**
* the default behvaior kicks in with ghjkDenoCacheDir is falsy
* ghjkDenoCacheDir: undefined,
*/
noLockfile: false,
ghjkConfigDir: $.path(dirs().configDir).toString(),
};

const shellConfig: Record<string, string> = {
2 changes: 2 additions & 0 deletions src/ghjk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -63,6 +63,8 @@ dashmap = { version = "5.5", features = ["serde"]}
clap = { workspace = true, features = ["derive", "env"] }
clap_complete = "=4.5.24"
shadow-rs.workspace = true
# TODO: support more config formats
config = { version = "0.14.1", default-features = false, features = ["async", "json5", "json"] }

multihash = "0.19.2"
json-canon = "0.1.3"
113 changes: 103 additions & 10 deletions src/ghjk/cli.rs
Original file line number Diff line number Diff line change
@@ -5,14 +5,21 @@ use clap::builder::styling::AnsiColor;
use crate::interlude::*;

use crate::systems::{CliCommandAction, SystemCliCommand};
use crate::{host, systems, utils, Config};
use crate::{host, systems, utils};

#[derive(Debug)]
pub struct Config {
pub ghjkfile_path: Option<PathBuf>,
pub ghjkdir_path: Option<PathBuf>,
pub share_dir_path: PathBuf,
}

const DENO_UNSTABLE_FLAGS: &[&str] = &["worker-options", "kv"];

pub async fn cli() -> Res<std::process::ExitCode> {
let cwd = std::env::current_dir()?;

let config = {
let (config, deno_lockfile_path) = {
let ghjk_dir_path = match std::env::var("GHJK_DIR") {
Ok(path) => Some(PathBuf::from(path)),
Err(std::env::VarError::NotUnicode(os_str)) => Some(PathBuf::from(os_str)),
@@ -40,10 +47,14 @@ pub async fn cli() -> Res<std::process::ExitCode> {
None => utils::find_entry_recursive(&cwd, "ghjk.ts").await?,
};

let ghjkfile_path = if let Some(path) = ghjkfile_path {
Some(tokio::fs::canonicalize(path).await?)
let (ghjkfile_path, ghjk_dir_path) = if let Some(path) = ghjkfile_path {
let file_path = tokio::fs::canonicalize(path).await?;
// if ghjkfile var is set, set the GHJK_DIR overriding
// any set by the user
let dir_path = file_path.parent().unwrap().join(".ghjk");
(Some(file_path), Some(dir_path))
} else {
None
(None, ghjk_dir_path)
};

if ghjk_dir_path.is_none() && ghjkfile_path.is_none() {
@@ -60,11 +71,25 @@ pub async fn cli() -> Res<std::process::ExitCode> {
.data_local_dir()
.join("ghjk"),
};
Config {
ghjkfile_path,
ghjkdir_path: ghjk_dir_path,
share_dir_path,
}

let deno_lockfile_path = match std::env::var("GHJK_DENO_LOCKFILE") {
Ok(str) if str == "off" => None,
Ok(path) => Some(PathBuf::from(path)),
Err(std::env::VarError::NotUnicode(os_str)) => Some(PathBuf::from(os_str)),
Err(std::env::VarError::NotPresent) => match &ghjk_dir_path {
Some(path) => Some(path.join("deno.lock")),
None => None,
},
};

(
Config {
ghjkfile_path,
ghjkdir_path: ghjk_dir_path,
share_dir_path,
},
deno_lockfile_path,
)
};

let Some(quick_err) = try_quick_cli(&config).await? else {
@@ -75,7 +100,11 @@ pub async fn cli() -> Res<std::process::ExitCode> {
quick_err.exit();
};

// TODO: create ghjk_dir_path if it doens't exist
// TODO: create .gitignore file as well

let deno_cx = denort::worker(
// TODO: DENO_FLAGS param simlar to V8_FLAGS
denort::deno::args::Flags {
unstable_config: denort::deno::args::UnstableConfig {
features: DENO_UNSTABLE_FLAGS
@@ -85,6 +114,8 @@ pub async fn cli() -> Res<std::process::ExitCode> {
.collect(),
..default()
},
no_lock: deno_lockfile_path.is_none(),
lock: deno_lockfile_path.map(|path| path.to_string_lossy().into()),
..default()
},
Some(Arc::new(Vec::new)),
@@ -168,6 +199,9 @@ pub async fn cli() -> Res<std::process::ExitCode> {
_ = commands.action(&config, Some(&systems.config))?;
return Ok(ExitCode::SUCCESS);
}
Ok(QuickComands::Deno { .. }) => {
unreachable!("deno quick cli will prevent this")
}
Err(err) => {
let kind = err.kind();
use clap::error::ErrorKind;
@@ -236,6 +270,7 @@ pub async fn try_quick_cli(config: &Config) -> Res<Option<clap::Error>> {
)));
}
}
QuickComands::Deno { .. } => unreachable!("deno quick cli will have prevented this"),
}

Ok(None)
@@ -265,6 +300,11 @@ enum QuickComands {
#[command(subcommand)]
commands: PrintCommands,
},
/// Access the deno cli
Deno {
#[arg(raw(true))]
args: String,
},
}

#[derive(clap::Subcommand, Debug)]
@@ -413,3 +453,56 @@ async fn action_for_match(
let (action, matches) = inner(action, matches, &mut cmd_path)?;
Ok((cmd_path, action, matches))
}

/// TODO: keep more of this in deno next time it's updated
pub fn deno_quick_cli() -> Option<()> {
let argv = std::env::args_os().skip(1).collect::<Vec<_>>();
let Some(first) = argv.get(0) else {
return None;
};
if first != "deno" {
return None;
}
deno::util::unix::raise_fd_limit();
deno::util::windows::ensure_stdio_open();
deno_runtime::deno_permissions::set_prompt_callbacks(
Box::new(deno::util::draw_thread::DrawThread::hide),
Box::new(deno::util::draw_thread::DrawThread::show),
);

let future = async move {
// NOTE(lucacasonato): due to new PKU feature introduced in V8 11.6 we need to
// initialize the V8 platform on a parent thread of all threads that will spawn
// V8 isolates.
let flags = deno::resolve_flags_and_init(argv)?;
deno::run_subcommand(Arc::new(flags)).await
};

let result = deno_runtime::tokio_util::create_and_run_current_thread_with_maybe_metrics(future);

match result {
Ok(exit_code) => deno_runtime::exit(exit_code),
Err(err) => exit_for_error(err),
}
}

fn exit_with_message(message: &str, code: i32) -> ! {
tracing::error!("error: {}", message.trim_start_matches("error: "));
deno_runtime::exit(code);
}

fn exit_for_error(error: anyhow::Error) -> ! {
let mut error_string = format!("{error:?}");
let error_code = 1;

if let Some(e) = error.downcast_ref::<deno_core::error::JsError>() {
error_string = deno_runtime::fmt_errors::format_js_error(e);
} /* else if let Some(SnapshotFromLockfileError::IntegrityCheckFailed(e)) =
error.downcast_ref::<SnapshotFromLockfileError>()
{
error_string = e.to_string();
error_code = 10;
} */

exit_with_message(&error_string, error_code);
}
14 changes: 7 additions & 7 deletions src/ghjk/main.rs
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ mod interlude {
mod host;

mod cli;
mod config;
mod ext;
mod log;
mod systems;
@@ -40,12 +41,18 @@ mod utils;
use crate::interlude::*;

fn main() -> Res<std::process::ExitCode> {
let None = cli::deno_quick_cli() else {
unreachable!();
};

// FIXME: change signal handler for children
// FIXME: use unix_sigpipe once https://github.com/rust-lang/rust/issues/97889 lands
unsafe {
use nix::sys::signal::*;
signal(Signal::SIGPIPE, SigHandler::SigDfl)?;
}
std::env::set_var("DENO_NO_UPDATE_CHECK", "1");

log::init();
denort::init();

@@ -68,10 +75,3 @@ pub struct GhjkCtx {
ghjk_dir_path: PathBuf,
share_dir_path: PathBuf,
}

#[derive(Debug)]
struct Config {
ghjkfile_path: Option<PathBuf>,
ghjkdir_path: Option<PathBuf>,
share_dir_path: PathBuf,
}
4 changes: 2 additions & 2 deletions tests/test-alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG DENO_V=1.42.1
ARG DENO_VERSION=2.1.2

FROM docker.io/denoland/deno:alpine-${DENO_V}
FROM docker.io/denoland/deno:alpine-${DENO_VERSION}

ARG BASH_V=5.2.21-r0
ARG FISH_V=3.6.3-r0
4 changes: 2 additions & 2 deletions tests/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG DENO_VERSION=1.44.2
ARG DENO_VERSION=2.1.2

FROM denoland/deno:bin-$DENO_VERSION AS deno
FROM docker.io/denoland/deno:bin-$DENO_VERSION AS deno

FROM docker.io/library/debian:12-slim

21 changes: 15 additions & 6 deletions tests/utils.ts
Original file line number Diff line number Diff line change
@@ -68,12 +68,21 @@ export async function dockerE2eTest(testCase: E2eTestCase) {
.replaceAll("$", "$$$$"),
));

await $
.raw`${dockerCmd} buildx build ${dockerPlatform} ${
Object.entries(env).map(([key, val]) => ["--build-arg", `${key}=${val}`])
} --tag '${tag}' --network=host --output type=docker -f- .`
.env(env)
.stdinText(dFile);
if (dockerCmd[0] == "podman") {
await $
.raw`${dockerCmd} buildah build ${dockerPlatform} ${
Object.entries(env).map(([key, val]) => ["--build-arg", `${key}=${val}`])
} --tag '${tag}' --network=host -- -f- .`
.env(env)
.stdinText(dFile);
} else {
await $
.raw`${dockerCmd} buildx build ${dockerPlatform} ${
Object.entries(env).map(([key, val]) => ["--build-arg", `${key}=${val}`])
} --tag '${tag}' --network=host --output type=docker -f- .`
.env(env)
.stdinText(dFile);
}

for (const ePoint of ePoints) {
let cmd = $.raw`${dockerCmd} run ${dockerPlatform} --rm ${[
2 changes: 2 additions & 0 deletions utils/mod.ts
Original file line number Diff line number Diff line change
@@ -325,7 +325,9 @@ export function dirs() {
}
return {
homeDir: home,
// FIXME: use proper xdg dirs
shareDir: $.path(home).resolve(".local", "share"),
configDir: $.path(home).resolve(".config", "ghjk"),
};
}

0 comments on commit e49fef5

Please sign in to comment.