Skip to content

Commit 9f1cbad

Browse files
committed
fix: stabilize windows script test and fixture format
1 parent a7f3491 commit 9f1cbad

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

  • crates/vite_install/src/commands
  • packages/cli/snap-tests-global/command-release-dry-run/packages/pkg-a

crates/vite_install/src/commands/script.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,27 @@ impl PackageManager {
4545

4646
#[cfg(test)]
4747
mod tests {
48+
use std::env;
49+
4850
use vite_path::AbsolutePathBuf;
4951

5052
use super::*;
5153
use crate::package_manager::PackageManagerType;
5254

55+
fn temp_absolute_path() -> AbsolutePathBuf {
56+
AbsolutePathBuf::new(env::temp_dir()).unwrap()
57+
}
58+
5359
fn make_pm(client: PackageManagerType) -> PackageManager {
5460
PackageManager {
5561
client,
5662
package_name: "pm".into(),
5763
version: "1.0.0".into(),
5864
hash: None,
5965
bin_name: client.to_string().into(),
60-
workspace_root: AbsolutePathBuf::new("/tmp".into()).unwrap(),
66+
workspace_root: temp_absolute_path(),
6167
is_monorepo: false,
62-
install_dir: AbsolutePathBuf::new("/tmp".into()).unwrap(),
68+
install_dir: temp_absolute_path(),
6369
}
6470
}
6571

packages/cli/snap-tests-global/command-release-dry-run/packages/pkg-a/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "pkg-a",
33
"version": "1.0.0",
4-
"type": "module",
54
"repository": "https://github.com/example/release-fixture.git",
5+
"type": "module",
66
"scripts": {
77
"build": "node -e \"console.log('build')\""
88
}

0 commit comments

Comments
 (0)