Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 make sure non java files are exploded to java project #760

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ func explode(ctx context.Context, log logr.Logger, archivePath, projectPath stri

if f.FileInfo().IsDir() {
// make sure execute bits are set so that fernflower can decompile
os.MkdirAll(filePath, f.Mode()|0111)
err := os.MkdirAll(filePath, f.Mode()|0111)
if err != nil {
log.V(5).Error(err, "failed to create directory when exploding the archive", "filePath", filePath)
}
continue
}

Expand Down Expand Up @@ -391,6 +394,19 @@ func explode(ctx context.Context, log logr.Logger, archivePath, projectPath stri
})
}
}
// any other files, move to java project as-is
default:
destPath := filepath.Join(
projectPath, strings.Replace(filepath.Base(archivePath), ".", "-", -1)+"-exploded", f.Name)
if err := os.MkdirAll(filepath.Dir(destPath), 0755); err != nil {
log.V(8).Error(err, "error creating directory for java file", "path", destPath)
continue
}
if err := moveFile(filePath, destPath); err != nil {
log.V(8).Error(err, "error moving decompiled file to project path",
"src", filePath, "dest", destPath)
continue
}
}
}

Expand Down
Loading