fixed editor new project init for new example folder layout

This commit is contained in:
Anton-4 2022-03-08 14:21:26 +01:00
parent c79fc18ba8
commit 62d249acd5
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD
3 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ use crate::lang::core::{expr::expr2::ExprId, header::AppHeader};
pub fn parse_from_string(_header_str: &str, ast_node_id: ExprId) -> AppHeader { pub fn parse_from_string(_header_str: &str, ast_node_id: ExprId) -> AppHeader {
AppHeader { AppHeader {
app_name: "\"untitled-app\"".to_owned(), app_name: "\"untitled-app\"".to_owned(),
packages_base: "\"platform\"".to_owned(), packages_base: "\"c-platform\"".to_owned(),
imports: vec![], imports: vec![],
provides: vec!["main".to_owned()], provides: vec!["main".to_owned()],
ast_node_id, ast_node_id,

View file

@ -517,14 +517,14 @@ fn read_main_roc_file(project_dir_path_opt: Option<&Path>) -> (PathStr, String)
// returns path and content of app file // returns path and content of app file
fn init_new_roc_project(project_dir_path_str: &str) -> (PathStr, String) { fn init_new_roc_project(project_dir_path_str: &str) -> (PathStr, String) {
let orig_platform_path = Path::new("./examples/hello-c/platform"); let orig_platform_path = Path::new("./examples/hello-world/c-platform");
let project_dir_path = Path::new(project_dir_path_str); let project_dir_path = Path::new(project_dir_path_str);
let roc_file_path_str = vec![project_dir_path_str, "/UntitledApp.roc"].join(""); let roc_file_path_str = vec![project_dir_path_str, "/UntitledApp.roc"].join("");
let roc_file_path = Path::new("./new-roc-project/UntitledApp.roc"); let roc_file_path = Path::new("./new-roc-project/UntitledApp.roc");
let project_platform_path_str = vec![project_dir_path_str, "/platform"].join(""); let project_platform_path_str = vec![project_dir_path_str, "/c-platform"].join("");
let project_platform_path = Path::new(&project_platform_path_str); let project_platform_path = Path::new(&project_platform_path_str);
if !project_dir_path.exists() { if !project_dir_path.exists() {

View file

@ -17,7 +17,7 @@ For convenience and consistency, there is only one way to format roc.
pub const HELLO_WORLD: &str = r#" pub const HELLO_WORLD: &str = r#"
app "test-app" app "test-app"
packages { pf: "platform" } packages { pf: "c-platform" }
imports [] imports []
provides [ main ] to pf provides [ main ] to pf