mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-22 12:49:56 +08:00
Rename to uniform path
This commit is contained in:
parent
87858ed7a8
commit
fe7e08c6a5
16
chsrc.c
16
chsrc.c
|
@ -434,7 +434,7 @@ pl_java_check_cmd_(bool* maven_exist, bool* gradle_exist)
|
|||
*gradle_exist = does_the_program_exist (check_cmd, "gradle");
|
||||
|
||||
if (! *maven_exist && ! *gradle_exist) {
|
||||
chsrc_error ("maven 与 gradle 命令均未找到,请检查是否存在(其一)");
|
||||
chsrc_error ("maven 与 gradle 命令均未找到,请检查是否存在其一");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -452,13 +452,7 @@ pl_java_find_maven_config_ ()
|
|||
// xy_info (buf);
|
||||
maven_home = xy_str_strip(maven_home);
|
||||
|
||||
char* maven_config = NULL;
|
||||
|
||||
if (xy_on_windows)
|
||||
maven_config = xy_2strjoin(maven_home, "\\conf\\settings.xml");
|
||||
else
|
||||
maven_config = xy_2strjoin(maven_home, "/conf/settings.xml");
|
||||
|
||||
char* maven_config = xy_uniform_path(xy_2strjoin(maven_home, "/conf/settings.xml"));
|
||||
return maven_config;
|
||||
}
|
||||
|
||||
|
@ -613,15 +607,15 @@ pl_haskell_setsrc(char* option)
|
|||
|
||||
char* config = NULL;
|
||||
if (xy_on_windows) {
|
||||
config = xy_2strjoin(xy_os_home, "\\AppData\\Roaming\\cabal\\config");
|
||||
config = xy_uniform_path ("~/AppData/Roaming/cabal/config");
|
||||
} else {
|
||||
config = xy_2strjoin(xy_os_home, "/.cabal/config");
|
||||
config = "~/.cabal/config";
|
||||
}
|
||||
|
||||
xy_info(xy_strjoin(3,"chsrc: 请向 ", config, " 中手动添加:"));
|
||||
puts(file); puts("");
|
||||
|
||||
config = xy_2strjoin(xy_os_home, "/.stack/config.yaml");
|
||||
config = xy_uniform_path ("~/.stack/config.yaml");
|
||||
file = xy_strjoin(3, "package-indices:\n"
|
||||
" - download-prefix: ", source.url,
|
||||
"\n hackage-security:\n"
|
||||
|
|
4
chsrc.h
4
chsrc.h
|
@ -289,8 +289,8 @@ static void
|
|||
chsrc_check_file (const char* path)
|
||||
{
|
||||
char* cmd = NULL;
|
||||
path = xy_uniform_path (path);
|
||||
if(xy_on_windows) {
|
||||
path = xy_unix_path_to_win (path);
|
||||
cmd = xy_2strjoin ("type ", path);
|
||||
} else {
|
||||
cmd = xy_2strjoin ("cat ", path);
|
||||
|
@ -301,6 +301,7 @@ chsrc_check_file (const char* path)
|
|||
static void
|
||||
chsrc_append_to_file (const char* str, const char* file)
|
||||
{
|
||||
file = xy_uniform_path (file);
|
||||
char* cmd = NULL;
|
||||
if (xy_on_windows) {
|
||||
cmd = xy_strjoin (4, "echo ", str, " >> ", file);
|
||||
|
@ -313,6 +314,7 @@ chsrc_append_to_file (const char* str, const char* file)
|
|||
static void
|
||||
chsrc_overwrite_file (const char* str, const char* file)
|
||||
{
|
||||
file = xy_uniform_path (file);
|
||||
char* cmd = NULL;
|
||||
if (xy_on_windows) {
|
||||
cmd = xy_strjoin (4, "echo ", str, " > ", file);
|
||||
|
|
|
@ -91,7 +91,7 @@ main (int argc, char const *argv[])
|
|||
assert(xy_file_exist(xy_win_powershell_profile));
|
||||
assert(false==xy_file_exist(xy_win_powershellv5_profile));
|
||||
|
||||
puts (xy_unix_path_to_win_if_on_win(" \n ~/haha/test/123 \n\r "));
|
||||
puts (xy_uniform_path(" \n ~/haha/test/123 \n\r "));
|
||||
|
||||
xy_success("测试全部通过");
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user