Skip to content

Commit

Permalink
refactor: remove unused items
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Nov 16, 2023
1 parent e1c3864 commit f073279
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions crates/testing-utils/src/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,6 @@ impl CommandTempCwd<()> {
}
}

/// Information after the creation of an `.npmrc` file from assets provided by [`CommandTempCwd`].
pub struct AddDefaultNpmrcInfo {
/// Path to the created `.npmrc` file.
pub npmrc_path: PathBuf,
/// Absolute path to the store directory as defined by the `.npmrc` file.
pub store_dir: PathBuf,
/// Absolute path to the cache directory as defined by the `.npmrc` file.
pub cache_dir: PathBuf,
}

impl CommandTempCwd<()> {
/// Create a `.npmrc` file that defines `store-dir` and `cache-dir`.
pub fn add_default_npmrc(self) -> CommandTempCwd<AddDefaultNpmrcInfo> {
let store_dir = self.root.path().join("pacquet-store");
let cache_dir = self.root.path().join("pacquet-cache");
let npmrc_path = self.workspace.join(".npmrc");
let npmrc_text = text_block_fnl! {
"store-dir=../pacquet-store"
"cache-dir=../pacquet-cache"
};
fs::write(&npmrc_path, npmrc_text).expect("write to .npmrc");
let npmrc_info = AddDefaultNpmrcInfo { npmrc_path, store_dir, cache_dir };
let CommandTempCwd { pacquet, pnpm, root, workspace, npmrc_info: () } = self;
CommandTempCwd { pacquet, pnpm, root, workspace, npmrc_info }
}
}

/// Information after the creation of an `.npmrc` file from assets provided by [`CommandTempCwd`].
#[must_use]
pub struct AddMockedRegistry {
Expand Down

0 comments on commit f073279

Please sign in to comment.