Skip to content

Commit cafd5c4

Browse files
committed
fix(ConfigFileUpdate): no need to create user build if shared build is up-to-date
1 parent 831ffba commit cafd5c4

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/rime/lever/deployment_tasks.cc

+15-8
Original file line numberDiff line numberDiff line change
@@ -386,16 +386,23 @@ static bool ConfigNeedsUpdate(Config* config) {
386386
"config_source_file", "", ".yaml"
387387
}));
388388
for (auto entry : *timestamps.AsMap()) {
389-
fs::path source_file_path = resolver->ResolvePath(entry.first);
390-
if (!fs::exists(source_file_path)) {
391-
LOG(INFO) << "source file no longer exists: " << source_file_path.string();
392-
return true;
393-
}
394389
auto value = As<ConfigValue>(entry.second);
395390
int recorded_time = 0;
396-
if (!value || !value->GetInt(&recorded_time) ||
397-
recorded_time != (int) fs::last_write_time(source_file_path)) {
398-
LOG(INFO) << "source file changed: " << source_file_path.string();
391+
if (!value || !value->GetInt(&recorded_time)) {
392+
LOG(WARNING) << "invalid timestamp for " << entry.first;
393+
return true;
394+
}
395+
fs::path source_file = resolver->ResolvePath(entry.first);
396+
if (!fs::exists(source_file)) {
397+
if (recorded_time) {
398+
LOG(INFO) << "source file no longer exists: " << source_file.string();
399+
return true;
400+
}
401+
continue;
402+
}
403+
if (recorded_time != (int) fs::last_write_time(source_file)) {
404+
LOG(INFO) << "source file " << (recorded_time ? "changed: " : "added: ")
405+
<< source_file.string();
399406
return true;
400407
}
401408
}

0 commit comments

Comments
 (0)