* Cache hashed assets forever in fullstack * fix clippy * fix fullstack test port * fix fullstack clippy * fix double insertion of meta in fullstack test * pull out head element changes * Fix cli-optimization test when interrupted * remove tests for raw assets * fix playwright tests * look for hash in asset name instead of building a manifest * undo changes to cli * fix clippy * fix test_file_name_looks_immutable
17 lines
636 B
Rust
17 lines
636 B
Rust
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
// If the monaco editor folder doesn't exist, download it
|
|
let monaco_path = PathBuf::from("monaco-editor");
|
|
if monaco_path.exists() {
|
|
return;
|
|
}
|
|
|
|
let url = "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz";
|
|
let bytes = reqwest::blocking::get(url).unwrap().bytes().unwrap();
|
|
let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(bytes.as_ref()));
|
|
let monaco_path_partial = PathBuf::from("partial-monaco-editor");
|
|
archive.unpack(&monaco_path_partial).unwrap();
|
|
std::fs::rename(monaco_path_partial, monaco_path).unwrap();
|
|
}
|