Skip to content

Commit

Permalink
Merge #227
Browse files Browse the repository at this point in the history
227: Adds warning that frontend code is not compiled yet. r=tcr a=tcr

bors r+

Co-authored-by: Tim Ryan <[email protected]>
  • Loading branch information
bors[bot] and tcr committed Dec 18, 2018
2 parents 37e99ff + 059f371 commit 8bcb38a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 32 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions build-tools/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,22 +547,6 @@ fn run() -> Result<(), Error> {
println!("Database path: edit-server/edit.sqlite3");
}

// Build dist folder if it doesn't exist.
if !Path::new("edit-frontend/dist/edit.js").exists() {
execute!(
r"
{self_path} wasm-build
",
self_path = SELF_PATH,
)?;
execute!(
r"
{self_path} frontend-build
",
self_path = SELF_PATH,
)?;
}

eprintln!("Starting server...");

let release_flag = if release { Some("--release") } else { None };
Expand Down Expand Up @@ -590,22 +574,6 @@ fn run() -> Result<(), Error> {
Cli::ServerBuild { args } => {
let release_flag = if release { Some("--release") } else { None };

// Build dist folder if it doesn't exist.
if !Path::new("edit-frontend/dist/edit.js").exists() {
execute!(
r"
{self_path} wasm-build
",
self_path = SELF_PATH,
)?;
execute!(
r"
{self_path} frontend-build
",
self_path = SELF_PATH,
)?;
}

execute!(
r"
cd edit-server
Expand Down
1 change: 1 addition & 0 deletions edit-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ take_mut = "0.2.0"
taken = "0.1.1"
url = "1.6.0"
ws = "0.7.3"
yansi = "0.5"

[dependencies.diesel]
features = ["sqlite"]
Expand Down
13 changes: 13 additions & 0 deletions edit-server/src/bin/edit-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use md5;
use reqwest;
use crypto::md5::Md5;
use crypto::digest::Digest;
use yansi::Paint;

#[macro_use]
extern crate serde_json;
Expand Down Expand Up @@ -184,6 +185,18 @@ fn run_http_server(port: u16, client_proxy: bool) {
assert!(template_dir.exists(Path::new("presentation.hbs")));
assert!(template_dir.exists(Path::new("favicon.png")));

// Build dist folder if it doesn't exist.
if dist_dir.get(Path::new("edit.js")).is_none() {
eprintln!("{}", Paint::yellow(r"
=======================================================
WARNING!
The file edit-frontend/dist/edit.js does not exist.
You should generate the frontend code by running
`./tools frontend-build` from a terminal window.
=======================================================
"));
}

println!(
"> Server listening for HTTP connections on http://0.0.0.0:{}/",
port
Expand Down

0 comments on commit 8bcb38a

Please sign in to comment.