Skip to content

Commit

Permalink
fix #24
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwiterrion committed Feb 12, 2024
1 parent 4c8c53b commit f3aa5b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cli/src/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ async fn build(path: Option<String>, server: Option<String>, host: Host, client_

match build_result {
websocket::BuildResult::Success => {
get_wasm(&configuration, &result.queue_id, &complete_path, &plugin).await;
get_wasm(&configuration, &complete_path, &plugin).await;
}
_ => logger::println(format!("Build failed")),
}
Expand All @@ -471,14 +471,13 @@ async fn build(path: Option<String>, server: Option<String>, host: Host, client_

async fn get_wasm(
configuration: &HashMap<String, String>,
id: &str,
output_path: &str,
plugin: &plugin::Plugin,
) {
let url = format!(
"{}/local/wasm/{}",
&configuration.get(WASMO_SERVER).unwrap(),
id
format!("{}-{}-dev", &plugin.metadata.name, &plugin.metadata.version)
);

logger::loading("<yellow>Fetch</> wasm file".to_string());
Expand Down
1 change: 1 addition & 0 deletions cli/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pub fn read_plugin(path: &String) -> Plugin {
fn read_files_contents(files: &Vec<DirEntry>) -> Vec<PluginFile> {
let r = files
.into_iter()
// .filter(|file| file.file != ".DS_Store")
.map(|file| PluginFile {
content: fs::read_to_string(file.path()).unwrap(),
name: file.file_name().into_string().unwrap(),
Expand Down
8 changes: 7 additions & 1 deletion server/services/file-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ const writeFiles = (files, folder, isRustBuild) => {


const storeWasm = fromFolder => {
return fs.move(fromFolder, pathsToPath(`/wasm/${fromFolder.split('/').slice(-1)[0]}.wasm`))
return fs.move(
fromFolder,
pathsToPath(`/wasm/${fromFolder.split('/').slice(-1)[0]}.wasm`),
{
overwrite: true
}
)
};

const getLocalWasm = (id, res) => {
Expand Down

0 comments on commit f3aa5b0

Please sign in to comment.