Kotlin extractor: fix K2 regressions without expected churn by andersfugmann · Pull Request #22076 · github/codeql · GitHub
Skip to content
Draft
1 change: 0 additions & 1 deletion CODEOWNERS
10 changes: 7 additions & 3 deletions java/kotlin-extractor/dev/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def get_version():


def install(version: str, quiet: bool):
if install_dir.exists():
return

if quiet:
info_out = subprocess.DEVNULL
info = lambda *args: None
Expand All @@ -83,8 +86,6 @@ def install(version: str, quiet: bool):
info = lambda *args: print(*args, file=sys.stderr)
file = file_template.format(version=version)
url = url_template.format(version=version)
if install_dir.exists():
shutil.rmtree(install_dir)
install_dir.mkdir()
zips_dir.mkdir(exist_ok=True)
zip = zips_dir / file
Expand Down Expand Up @@ -156,8 +157,11 @@ def main(opts, forwarded_opts):
selected_version = current_version or DEFAULT_VERSION
if selected_version != current_version:
# don't print information about install procedure unless explicitly using --select
install(selected_version, quiet=opts.select is None)
if install_dir.exists():
shutil.rmtree(install_dir)
version_file.write_text(selected_version)
# don't print information about install procedure unless explicitly using --select
install(selected_version, quiet=opts.select is None)
if opts.select and not forwarded_opts and not opts.version:
print(f"selected {selected_version}")
return
Expand Down
182 changes: 162 additions & 20 deletions java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt
Loading
Loading