mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-26 00:55:59 +00:00
Remove transitional projects code ##projects
This commit is contained in:
parent
7edd5459dc
commit
a5c351c725
@ -85,26 +85,30 @@ static int cmd_project(void *data, const char *input) {
|
||||
case '-': // "P-"
|
||||
r_core_project_delete (core, file);
|
||||
break;
|
||||
case 's':
|
||||
case 's': // "Ps"
|
||||
if (R_STR_ISEMPTY (file)) {
|
||||
file = str;
|
||||
}
|
||||
if (r_core_project_save (core, file)) {
|
||||
r_cons_println (file);
|
||||
if (!R_STR_ISEMPTY (file)) {
|
||||
if (!r_core_project_save (core, file)) {
|
||||
r_cons_eprintf ("Cannot save project.\n");
|
||||
}
|
||||
} else {
|
||||
r_cons_eprintf ("Use: Ps [projectname]\n");
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
case 'S': // "PS"
|
||||
if (input[1] == ' ') {
|
||||
r_core_project_save_script (core, input + 2, R_CORE_PRJ_ALL);
|
||||
} else {
|
||||
eprintf ("Usage: PS [file]\n");
|
||||
r_cons_eprintf ("Usage: PS [file]\n");
|
||||
}
|
||||
break;
|
||||
case 'n': // "Pn"
|
||||
if (input[1] == '?') {
|
||||
r_core_cmd_help (core, help_msg_Pn);
|
||||
} else if (!fileproject || !*fileproject) {
|
||||
eprintf ("No project\n");
|
||||
r_cons_eprintf ("No project\n");
|
||||
} else {
|
||||
switch (input[1]) {
|
||||
case '-': // "Pn-"
|
||||
|
@ -702,8 +702,6 @@ R_API bool r_core_project_save_script(RCore *core, const char *file, int opts) {
|
||||
return project_save_script (core, file, opts);
|
||||
}
|
||||
|
||||
#define TRANSITION 1
|
||||
|
||||
R_API bool r_core_project_save(RCore *core, const char *prj_name) {
|
||||
bool scr_null = false;
|
||||
bool ret = true;
|
||||
@ -728,25 +726,7 @@ R_API bool r_core_project_save(RCore *core, const char *prj_name) {
|
||||
}
|
||||
if (r_file_exists (script_path)) {
|
||||
if (r_file_is_directory (script_path)) {
|
||||
eprintf ("WTF. rc is a directory?\n");
|
||||
}
|
||||
if (r_str_endswith (prj_dir, ".d")) {
|
||||
eprintf ("Upgrading project...\n");
|
||||
#if TRANSITION
|
||||
r_file_rm (script_path);
|
||||
r_sys_mkdirp (prj_dir);
|
||||
eprintf ("Please remove: rm -rf %s %s.d\n", prj_name, prj_name);
|
||||
char *rc = r_str_newf ("%s" R_SYS_DIR "rc.r2", prj_dir);
|
||||
if (!rc) {
|
||||
free (prj_dir);
|
||||
free (script_path);
|
||||
return false;
|
||||
}
|
||||
free (script_path);
|
||||
script_path = rc;
|
||||
free (prj_dir);
|
||||
prj_dir = r_file_dirname (script_path);
|
||||
#endif
|
||||
eprintf ("Structural error: rc.r2 shouldnt be a directory.\n");
|
||||
}
|
||||
}
|
||||
if (!prj_dir) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user