core: Fix up plugin archive setup.
This commit is contained in:
parent
c63a3e0060
commit
09ec33edec
|
@ -120,8 +120,14 @@ dependencies = ["prepare-js-env"]
|
||||||
[tasks.build-plugin-archive]
|
[tasks.build-plugin-archive]
|
||||||
category = "Rookeries"
|
category = "Rookeries"
|
||||||
describe = "Build the plugin archive"
|
describe = "Build the plugin archive"
|
||||||
command = "zip"
|
script = [
|
||||||
args = ["-v", "rookeries-plugins.zip", "plugins/*.js"]
|
"mkdir -p tmp/plugins",
|
||||||
|
"cp plugins/*-plugin.js tmp/plugins/",
|
||||||
|
"chdir tmp && zip -rv rookeries-plugins.zip plugins",
|
||||||
|
"mv rookeries-plugins.zip ..",
|
||||||
|
"chdir ..",
|
||||||
|
"rm -rv tmp",
|
||||||
|
]
|
||||||
dependencies = ["prepare-js-env"]
|
dependencies = ["prepare-js-env"]
|
||||||
|
|
||||||
[tasks.build-all]
|
[tasks.build-all]
|
||||||
|
|
|
@ -31,10 +31,13 @@ fn extract_and_install_archive(installer_archive: &[u8], file_type: FileType) ->
|
||||||
let mut file = zip.by_index(i).unwrap();
|
let mut file = zip.by_index(i).unwrap();
|
||||||
let extracted_path = rookeries_home_cache.join(file.name());
|
let extracted_path = rookeries_home_cache.join(file.name());
|
||||||
|
|
||||||
|
|
||||||
if file.is_file() {
|
if file.is_file() {
|
||||||
|
debug!("File: {}", file.name());
|
||||||
let mut outfile = fs::File::create(&extracted_path)?;
|
let mut outfile = fs::File::create(&extracted_path)?;
|
||||||
std::io::copy(&mut file, &mut outfile)?;
|
std::io::copy(&mut file, &mut outfile)?;
|
||||||
} else if file.is_dir() {
|
} else if file.is_dir() {
|
||||||
|
debug!("Folder: {}", file.name());
|
||||||
fs::create_dir(extracted_path)
|
fs::create_dir(extracted_path)
|
||||||
.map_err(|err| RookeriesError::CreateDirectoryFailure(err, file_type))?;
|
.map_err(|err| RookeriesError::CreateDirectoryFailure(err, file_type))?;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue