From 62d249acd5918cb92f2bcbff6bcc3d8207a36062 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Tue, 8 Mar 2022 14:21:26 +0100 Subject: [PATCH] fixed editor new project init for new example folder layout --- ast/src/parse/parse_header.rs | 2 +- editor/src/editor/main.rs | 4 ++-- editor/src/editor/resources/strings.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ast/src/parse/parse_header.rs b/ast/src/parse/parse_header.rs index e387fea026..8ec881574a 100644 --- a/ast/src/parse/parse_header.rs +++ b/ast/src/parse/parse_header.rs @@ -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 { AppHeader { app_name: "\"untitled-app\"".to_owned(), - packages_base: "\"platform\"".to_owned(), + packages_base: "\"c-platform\"".to_owned(), imports: vec![], provides: vec!["main".to_owned()], ast_node_id, diff --git a/editor/src/editor/main.rs b/editor/src/editor/main.rs index fc2a4f3036..e5033e492d 100644 --- a/editor/src/editor/main.rs +++ b/editor/src/editor/main.rs @@ -517,14 +517,14 @@ fn read_main_roc_file(project_dir_path_opt: Option<&Path>) -> (PathStr, String) // returns path and content of app file 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 roc_file_path_str = vec![project_dir_path_str, "/UntitledApp.roc"].join(""); 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); if !project_dir_path.exists() { diff --git a/editor/src/editor/resources/strings.rs b/editor/src/editor/resources/strings.rs index c99234e626..52d99d24c1 100644 --- a/editor/src/editor/resources/strings.rs +++ b/editor/src/editor/resources/strings.rs @@ -17,7 +17,7 @@ For convenience and consistency, there is only one way to format roc. pub const HELLO_WORLD: &str = r#" app "test-app" - packages { pf: "platform" } + packages { pf: "c-platform" } imports [] provides [ main ] to pf