src/Tools/VSCode/src/build_vscodium.scala
changeset 76530 2bf13b30b98e
parent 76518 b30b8e23383c
child 76546 88cecb9f1cdc
equal deleted inserted replaced
76529:ded37aade88e 76530:2bf13b30b98e
    67 
    67 
    68     def download_name: String = "VSCodium-" + download_template.replace("{VERSION}", version)
    68     def download_name: String = "VSCodium-" + download_template.replace("{VERSION}", version)
    69     def download_zip: Boolean = File.is_zip(download_name)
    69     def download_zip: Boolean = File.is_zip(download_name)
    70 
    70 
    71     def download(dir: Path, progress: Progress = new Progress): Unit = {
    71     def download(dir: Path, progress: Progress = new Progress): Unit = {
    72       if (download_zip) Isabelle_System.require_command("unzip", test = "-h")
       
    73 
       
    74       Isabelle_System.with_tmp_file("download") { download_file =>
    72       Isabelle_System.with_tmp_file("download") { download_file =>
    75         Isabelle_System.download_file(vscodium_download + "/" + version + "/" + download_name,
    73         Isabelle_System.download_file(vscodium_download + "/" + version + "/" + download_name,
    76           download_file, progress = progress)
    74           download_file, progress = progress)
    77 
    75 
    78         progress.echo("Extract ...")
    76         progress.echo("Extract ...")
    79         if (download_zip) {
    77         Isabelle_System.extract(download_file, dir)
    80           Isabelle_System.bash("unzip -x " + File.bash_path(download_file), cwd = dir.file).check
       
    81         }
       
    82         else {
       
    83           Isabelle_System.gnutar("-xzf " + File.bash_path(download_file), dir = dir).check
       
    84         }
       
    85       }
    78       }
    86     }
    79     }
    87 
    80 
    88     def get_vscodium_repository(build_dir: Path, progress: Progress = new Progress): Unit = {
    81     def get_vscodium_repository(build_dir: Path, progress: Progress = new Progress): Unit = {
    89       progress.echo("Getting VSCodium repository ...")
    82       progress.echo("Getting VSCodium repository ...")