mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Fix trap extension for source files without extensions
We were writing files with names like `Gemfile..trap.gz`. Now fixed to `Gemfile.trap.gz`.
This commit is contained in:
@@ -40,8 +40,8 @@ impl TrapCompression {
|
||||
|
||||
fn extension(&self) -> &str {
|
||||
match self {
|
||||
TrapCompression::None => ".trap",
|
||||
TrapCompression::Gzip => ".trap.gz",
|
||||
TrapCompression::None => "trap",
|
||||
TrapCompression::Gzip => "trap.gz",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -269,6 +269,7 @@ fn path_for(dir: &Path, path: &Path, ext: &str) -> PathBuf {
|
||||
}
|
||||
if let Some(x) = result.extension() {
|
||||
let mut new_ext = x.to_os_string();
|
||||
new_ext.push(".");
|
||||
new_ext.push(ext);
|
||||
result.set_extension(new_ext);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user