MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / parseBuild

Method parseBuild

tools/mcpack.js:1138–1169  ·  view source on GitHub ↗
(platform)

Source from the content-addressed store, hash-verified

1136 }
1137 }
1138 parseBuild(platform) {
1139 let properties = platform.build;
1140 if (properties) {
1141 for (let name in properties) {
1142 let value = properties[name];
1143 if (typeof value == "string") {
1144 let shellValue;
1145 if (name.endsWith(" ?=") && !(name in this.environment)) {
1146 name = name.slice(0, -3);;
1147
1148 shellValue = this.getenv(name);
1149 if (undefined !== shellValue)
1150 value = shellValue;
1151 }
1152 if (undefined === shellValue) {
1153 const dotSlash = "." + this.slash;
1154 value = this.resolveVariable(value);
1155 if (value.startsWith(dotSlash)) {
1156 const path = this.resolveDirectoryPath(dotSlash);
1157 if (path) {
1158 if (dotSlash == value)
1159 value = path;
1160 else
1161 value = path + value.slice(1);
1162 }
1163 }
1164 }
1165 }
1166 this.environment[name] = value;
1167 }
1168 }
1169 }
1170 parseManifest(path, from) {
1171 if (this.manifests.already[path])
1172 return;

Callers 1

parseManifestMethod · 0.45

Calls 2

sliceMethod · 0.65
resolveVariableMethod · 0.45

Tested by

no test coverage detected