mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
Migration: don't overwrite existing files
This commit is contained in:
parent
4bf9f524d9
commit
7bc4c63eb4
@ -61,7 +61,8 @@ See Wiki: https://github.com/fastfetch-cli/fastfetch/wiki/Building
|
|||||||
* Run it with default configuration: `fastfetch`
|
* Run it with default configuration: `fastfetch`
|
||||||
* Run it with [all supported modules](https://github.com/fastfetch-cli/fastfetch/wiki/Support+Status#available-modules) and find what you interest: `fastfetch -c all.jsonc`
|
* Run it with [all supported modules](https://github.com/fastfetch-cli/fastfetch/wiki/Support+Status#available-modules) and find what you interest: `fastfetch -c all.jsonc`
|
||||||
* Find all data that fastfetch detects: `fastfetch -s <module> --format json`
|
* Find all data that fastfetch detects: `fastfetch -s <module> --format json`
|
||||||
* Get help messages: `fastfetch --help`
|
* Display help messages: `fastfetch --help`
|
||||||
|
* Generate config file based on command line arguments: `fastfetch --arg1 --arg2 --mirgrate-config`
|
||||||
|
|
||||||
## Customization
|
## Customization
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ static void parseOption(FFdata* data, const char* key, const char* value)
|
|||||||
{
|
{
|
||||||
if (instance.state.configDoc)
|
if (instance.state.configDoc)
|
||||||
{
|
{
|
||||||
fputs("Error: existing jsonc config file detected. Aborting\n", stderr);
|
fputs("Error: existing jsonc config detected. Aborting\n", stderr);
|
||||||
exit(477);
|
exit(477);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,6 +492,12 @@ static void parseOption(FFdata* data, const char* key, const char* value)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
ffStrbufSetS(&instance.state.migrateConfigPath, value);
|
ffStrbufSetS(&instance.state.migrateConfigPath, value);
|
||||||
|
|
||||||
|
if (ffPathExists(instance.state.migrateConfigPath.chars, FF_PATHTYPE_ANY))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error: file `%s` exists. Aborting\n", instance.state.migrateConfigPath.chars);
|
||||||
|
exit(477);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(ffStrEqualsIgnCase(key, "--load-user-config"))
|
else if(ffStrEqualsIgnCase(key, "--load-user-config"))
|
||||||
data->loadUserConfig = ffOptionParseBoolean(value);
|
data->loadUserConfig = ffOptionParseBoolean(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user