Skip to content
Snippets Groups Projects
Commit 6f58ced6 authored by rswindell's avatar rswindell
Browse files

Nelgin's mod (cleaned-up):

If a tickit.ini area section has "ForceReplace=true", then it'll treat
all the incoming .tic files for that area as though they have a "Replaces"
keyword.
parent 62959696
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,7 @@ function process_tic(tic) ...@@ -104,6 +104,7 @@ function process_tic(tic)
handler_arg = tickit.gcfg.handlerarg; handler_arg = tickit.gcfg.handlerarg;
} }
var force_replace_area = false;
cfg = tickit.acfg[tic.area.toLowerCase()]; cfg = tickit.acfg[tic.area.toLowerCase()];
if (cfg !== undefined) { if (cfg !== undefined) {
if (cfg.path !== undefined) { if (cfg.path !== undefined) {
...@@ -119,6 +120,8 @@ function process_tic(tic) ...@@ -119,6 +120,8 @@ function process_tic(tic)
handler = cfg.handler; handler = cfg.handler;
handler_arg = cfg.handlerarg; handler_arg = cfg.handlerarg;
} }
if (cfg.forcereplace !== undefined)
force_replace_area = cfg.forcereplace;
} }
if (handler !== undefined) { if (handler !== undefined) {
...@@ -166,7 +169,7 @@ function process_tic(tic) ...@@ -166,7 +169,7 @@ function process_tic(tic)
log(LOG_DEBUG, "Moving file from "+tic.full_path+" to "+path+"."); log(LOG_DEBUG, "Moving file from "+tic.full_path+" to "+path+".");
// TODO: optionally delete replaced files even if it's not an overwrite // TODO: optionally delete replaced files even if it's not an overwrite
if (file_exists(path+tic.file) && !force_replace) { if (file_exists(path+tic.file) && !force_replace && !force_replace_area) {
if (tic.replaces === undefined || !wildmatch(tic.file, tic.replaces)) { if (tic.replaces === undefined || !wildmatch(tic.file, tic.replaces)) {
log(LOG_ERROR, "'"+tic.full_path+"' already exists in '"+path+"' and TIC does not have matching Replaces line."); log(LOG_ERROR, "'"+tic.full_path+"' already exists in '"+path+"' and TIC does not have matching Replaces line.");
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment