From d6fb760f1ffc6ec2f35cdc3bfc9a8bcee9301fc1 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sat, 11 Nov 2017 17:04:05 -0500 Subject: [PATCH 1/3] Fixing a small bug in new project --- 4coder_project_commands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/4coder_project_commands.cpp b/4coder_project_commands.cpp index d7092d31..a68348e3 100644 --- a/4coder_project_commands.cpp +++ b/4coder_project_commands.cpp @@ -740,13 +740,13 @@ CUSTOM_COMMAND_SIG(setup_new_project){ replace_str(&output_dir, "\\\\", "/"); replace_str(&binary_file, "\\\\", "/"); - fprintf(project_script, "fkey_command_linux[1] = {\"build.sh\", \"*compilation*\", true , true };\n"); + fprintf(project_script, "fkey_command_linux[1] = {\"./build.sh\", \"*compilation*\", true , true };\n"); fprintf(project_script, "fkey_command_linux[2] = {\"%.*s/%.*s\", \"*run*\", false , true };\n", output_dir.size, output_dir.str, binary_file.size, binary_file.str); - fprintf(project_script, "fkey_command_mac[1] = {\"build.sh\", \"*compilation*\", true , true };\n"); + fprintf(project_script, "fkey_command_mac[1] = {\"./build.sh\", \"*compilation*\", true , true };\n"); fprintf(project_script, "fkey_command_mac[2] = {\"%.*s/%.*s\", \"*run*\", false , true };\n", output_dir.size, output_dir.str, From eb39575affca8acf3b7acbe9f3d2b45b085eca91 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sat, 11 Nov 2017 17:09:52 -0500 Subject: [PATCH 2/3] Cleaning up the build.sh part of new project generation --- 4coder_project_commands.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/4coder_project_commands.cpp b/4coder_project_commands.cpp index a68348e3..442ec7fc 100644 --- a/4coder_project_commands.cpp +++ b/4coder_project_commands.cpp @@ -582,27 +582,6 @@ project_is_setup(Application_Links *app, char *dir, int32_t dir_len, int32_t dir return(result); } -// TODO(allen): For this purpose we shouldn't go this far. -// Instead just let the CWD of the running script be the code home. -static char get_code_home[] = -"# Store the real CWD\n" -"REAL_PWD=\"$PWD\"\n\n" -"# Find the code home folder\n" -"TARGET_FILE=\"$0\"\n" -"cd `dirname $TARGET_FILE`\n" -"TARGET_FILE=`basename $TARGET_FILE`\n" -"while [ -L \"$TARGET_FILE\" ]\n" -"do\n" -"TARGET_FILE=`readlink $TARGET_FILE`\n" -"cd `dirname $TARGET_FILE`\n" -"TARGET_FILE=`basename $TARGET_FILE`\n" -"done\n" -"PHYS_DIR=`pwd -P`\n" -"SCRIPT_FILE=$PHYS_DIR/$TARGET_FILE\n" -"CODE_HOME=$(dirname \"$SCRIPT_FILE\")\n\n" -"# Restore the PWD\n" -"cd \"$REAL_PWD\"\n\n"; - // TODO(allen): Stop using stdio.h, switch to a 4coder buffer API for all file manipulation. #include CUSTOM_COMMAND_SIG(setup_new_project){ @@ -695,12 +674,12 @@ CUSTOM_COMMAND_SIG(setup_new_project){ if (sh_script != 0){ fprintf(sh_script, "#!/bin/bash\n\n"); - fprintf(sh_script, "%s", get_code_home); + fprintf(sh_script, "CODE_HOME=\"$PWD\"\n"); fprintf(sh_script, "OPTS=%.*s\n", default_flags_sh.size, default_flags_sh.str); - fprintf(sh_script, "pushd %.*s\n", + fprintf(sh_script, "pushd %.*s > /dev/null\n", output_dir.size, output_dir.str); fprintf(sh_script, "%.*s $OPTS $CODE_HOME/%.*s -o %.*s\n", default_compiler_sh.size, default_compiler_sh.str, From d67546b4b2d5772b8659353ff3b84133f52c1da8 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sat, 11 Nov 2017 17:32:49 -0500 Subject: [PATCH 3/3] Incremented 4coder version counter --- 4coder_API/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4coder_API/version.h b/4coder_API/version.h index 059f17c0..b0ee81e7 100644 --- a/4coder_API/version.h +++ b/4coder_API/version.h @@ -1,6 +1,6 @@ #define MAJOR 4 #define MINOR 0 -#define PATCH 22 +#define PATCH 23 // string #define VN__(a,b,c) #a "." #b "." #c