Skip to content

Commit

Permalink
fix: fix sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
akitaSummer committed Mar 11, 2024
1 parent 97d661a commit f33f576
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/lib/nydusd/fuse_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async function endNydusFs(cwd, pkg, force = true, daemon) {
);
if (os.type() === 'Darwin') {
await wrapRetry({
cmd: () => execa.command(wrapSudo(`${umountCmd} ${nodeModulesDir}`)),
cmd: () => execa.command(`${umountCmd} ${nodeModulesDir}`),
title: 'umount node_modules',
});
await fs.rm(nodeModulesDir, { recursive: true, force: true });
Expand Down
5 changes: 5 additions & 0 deletions packages/deamon/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ impl NydusdApiMount {
error!("Error executing umount: {:?}", e);
}

create_dir_if_not_exists(self.node_modules_dir.clone())?;

let str = format!(
r#"mount -o port=52100,mountport=52100,vers=4,namedattr,rwsize=262144,nobrowse -t nfs fuse-t:/rafs-/{} {}"#,
self.mountpoint, self.node_modules_dir
);

match start_command(&str) {
Ok(output) => {
if output.status.success() {
Expand Down Expand Up @@ -185,6 +188,8 @@ impl NydusdApiMount {
let body = String::from_utf8_lossy(&binding).to_string();

if body.contains("object or filesystem already exists") {
#[cfg(target_os = "macos")]
self.link_node_modules()?;
return Ok(());
}

Expand Down

0 comments on commit f33f576

Please sign in to comment.