There was an error while loading. Please reload this page.
1 parent 26c71f1 commit 6db63d8Copy full SHA for 6db63d8
1 file changed
src/env/unpack.rs
@@ -17,14 +17,15 @@ pub struct Args {
17
pub archive_path: PathBuf,
18
}
19
20
+fn archive_name_to_env_name(archive_path: &Path) -> Option<String> {
21
+ let filename = archive_path.file_name()?.to_str()?;
22
+ filename
23
+ .strip_suffix(".tar.gz")
24
+ .or_else(|| filename.strip_suffix(".tgz"))
25
+ .map(String::from)
26
+}
27
+
28
pub fn run(config: Config, args: Args) -> Result<(), ExitCode> {
- fn archive_name_to_env_name(archive_path: &Path) -> Option<String> {
- let filename = archive_path.file_name()?.to_str()?;
- filename
- .strip_suffix(".tar.gz")
- .or_else(|| filename.strip_suffix(".tgz"))
- .map(String::from)
- }
29
let env_name = match args.common.name {
30
Some(name) => name,
31
None => match archive_name_to_env_name(&args.archive_path) {
0 commit comments