Rename xy function

This commit is contained in:
Aoran Zeng
2024-11-21 20:17:24 +08:00
parent 5d7a13a56b
commit d7cc74c494
7 changed files with 18 additions and 18 deletions

View File

@@ -1039,7 +1039,7 @@ static void
chsrc_view_file (const char *path)
{
char *cmd = NULL;
path = xy_uniform_path (path);
path = xy_normalize_path (path);
if (xy_on_windows)
{
cmd = xy_2strjoin ("type ", path);
@@ -1054,7 +1054,7 @@ chsrc_view_file (const char *path)
static void
chsrc_ensure_dir (const char *dir)
{
dir = xy_uniform_path (dir);
dir = xy_normalize_path (dir);
if (xy_dir_exist (dir))
{
@@ -1081,7 +1081,7 @@ chsrc_ensure_dir (const char *dir)
static void
chsrc_append_to_file (const char *str, const char *file)
{
file = xy_uniform_path (file);
file = xy_normalize_path (file);
char *dir = xy_parent_dir (file);
chsrc_ensure_dir (dir);
@@ -1100,7 +1100,7 @@ chsrc_append_to_file (const char *str, const char *file)
static void
chsrc_prepend_to_file (const char *str, const char *file)
{
file = xy_uniform_path (file);
file = xy_normalize_path (file);
char *dir = xy_parent_dir (file);
chsrc_ensure_dir (dir);
@@ -1119,7 +1119,7 @@ chsrc_prepend_to_file (const char *str, const char *file)
static void
chsrc_overwrite_file (const char *str, const char *file)
{
file = xy_uniform_path (file);
file = xy_normalize_path (file);
char *dir = xy_parent_dir (file);
chsrc_ensure_dir (dir);

View File

@@ -33,7 +33,7 @@ pl_haskell_setsrc (char *option)
char *config = NULL;
if (xy_on_windows)
{
config = xy_uniform_path ("~/AppData/Roaming/cabal/config");
config = xy_normalize_path ("~/AppData/Roaming/cabal/config");
}
else
{
@@ -43,7 +43,7 @@ pl_haskell_setsrc (char *option)
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
puts (file); br();
config = xy_uniform_path ("~/.stack/config.yaml");
config = xy_normalize_path ("~/.stack/config.yaml");
file = xy_strjoin (3, "package-indices:\n"
" - download-prefix: ", source.url,
"\n hackage-security:\n"

View File

@@ -41,7 +41,7 @@ pl_java_find_maven_config ()
char *maven_home = xy_str_delete_prefix (buf, "Maven home: ");
maven_home = xy_str_strip (maven_home);
char *maven_config = xy_uniform_path (xy_2strjoin (maven_home, "/conf/settings.xml"));
char *maven_config = xy_normalize_path (xy_2strjoin (maven_home, "/conf/settings.xml"));
return maven_config;
}

View File

@@ -41,7 +41,7 @@ pl_nodejs_bun_setsrc (char *option)
}
else
{
chsrc_note2 (xy_strjoin (3, "请您手动写入以下内容到 ", xy_uniform_path ("~/.bunfig.toml"), " 文件中"));
chsrc_note2 (xy_strjoin (3, "请您手动写入以下内容到 ", xy_normalize_path ("~/.bunfig.toml"), " 文件中"));
}
puts (file);

View File

@@ -54,7 +54,7 @@ pl_rust_cargo_setsrc (char *option)
"[source.mirror]\n"
"registry = \"sparse+", source.url, "\"");
chsrc_note2 (xy_strjoin (3, "请您手动写入以下内容到 ", xy_uniform_path ("~/.cargo/config.toml"), " 文件中:"));
chsrc_note2 (xy_strjoin (3, "请您手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
puts (file);
chsrc_conclude (&source, SetsrcType_Manual);
}