Skip to content

Commit

Permalink
fix: dexing won't work
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashsaitwal committed Jul 11, 2021
1 parent 86adabf commit bc300b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn dex(base_dir: &Path) {
art_jar.to_str().unwrap(),
];

util::spawn_process(d8_path.as_path(), &args);
util::spawn_process("java", &args);
}

/// Returns the path to `d8.jar` stored in Rush's data directory.
Expand Down
6 changes: 4 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ use ansi_term::Color::Red;

/// Returns the Recast's data directory.
pub fn data_dir() -> PathBuf {
Path::new(&env::var("HOME").unwrap()).join(".recast")
let home = if cfg!(windows) { "UserProfile" } else { "HOME" };
Path::new(&env::var(home).unwrap()).join(".recast")
}

/// Spawns the [program] and passes [args] to it. Exits if the process doesn't completes successfully.
pub fn spawn_process<I, S>(program: &Path, args: I) -> Output
pub fn spawn_process<P, I, S>(program: P, args: I) -> Output
where
P: AsRef<OsStr>,
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
{
Expand Down

0 comments on commit bc300b1

Please sign in to comment.