Skip to content

Commit 45a04dd

Browse files
committed
fix(SchemaUpdate): read compiled schema from shared build if there is no user build
1 parent cafd5c4 commit 45a04dd

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/rime/lever/deployment_tasks.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,8 @@ bool WorkspaceUpdate::Run(Deployer* deployer) {
185185
int failure = 0;
186186
map<string, string> schemas;
187187
the<ResourceResolver> resolver(
188-
Service::instance().CreateResourceResolver({
189-
"schema", "", ".schema.yaml"
190-
}));
188+
Service::instance().CreateResourceResolver(
189+
{"schema", "", ".schema.yaml"}));
191190
auto build_schema = [&](const string& schema_id) {
192191
if (schemas.find(schema_id) != schemas.end()) // already built
193192
return;
@@ -348,9 +347,11 @@ bool SchemaUpdate::Run(Deployer* deployer) {
348347
if (verbose_) {
349348
dict_compiler.set_options(DictCompiler::kRebuild | DictCompiler::kDump);
350349
}
351-
ResourceResolver resolver({"compiled_schema", "build/", ".schema.yaml"});
352-
resolver.set_root_path(user_data_path);
353-
auto compiled_schema = resolver.ResolvePath(schema_id).string();
350+
the<ResourceResolver> resolver(
351+
Service::instance().CreateResourceResolver(
352+
{"compiled_schema", "build/", ".schema.yaml"}));
353+
resolver->set_root_path(user_data_path);
354+
auto compiled_schema = resolver->ResolvePath(schema_id).string();
354355
if (!dict_compiler.Compile(compiled_schema)) {
355356
LOG(ERROR) << "dictionary '" << dict_name << "' failed to compile.";
356357
return false;
@@ -382,9 +383,8 @@ static bool ConfigNeedsUpdate(Config* config) {
382383
return true;
383384
}
384385
the<ResourceResolver> resolver(
385-
Service::instance().CreateResourceResolver({
386-
"config_source_file", "", ".yaml"
387-
}));
386+
Service::instance().CreateResourceResolver(
387+
{"config_source_file", "", ".yaml"}));
388388
for (auto entry : *timestamps.AsMap()) {
389389
auto value = As<ConfigValue>(entry.second);
390390
int recorded_time = 0;

0 commit comments

Comments
 (0)