mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-22 18:29:48 +08:00
Use chsrc_check_file()
This commit is contained in:
13
chsrc.h
13
chsrc.h
@@ -272,7 +272,6 @@ not_root:
|
||||
#define chsrc_warn(str) xy_warn(xy_2strjoin(App_Prefix, (str)))
|
||||
#define chsrc_error(str) xy_error(xy_2strjoin(App_Prefix, (str)))
|
||||
|
||||
|
||||
static void
|
||||
chsrc_run (const char* cmd)
|
||||
{
|
||||
@@ -280,6 +279,18 @@ chsrc_run (const char* cmd)
|
||||
system(cmd);
|
||||
}
|
||||
|
||||
static void
|
||||
chsrc_check_file (const char* path)
|
||||
{
|
||||
char* cmd = NULL;
|
||||
if(xy_on_windows) {
|
||||
cmd = xy_2strjoin ("type ", path);
|
||||
} else {
|
||||
cmd = xy_2strjoin ("cat ", path);
|
||||
}
|
||||
chsrc_run (cmd);
|
||||
}
|
||||
|
||||
static void
|
||||
chsrc_append_to_file (const char* str, const char* file)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user