Skip to content

Commit

Permalink
fix(ios): also lookup semnantic colors in correct location for classic
Browse files Browse the repository at this point in the history
As it's intended to be cross platform this is the right place for a classic app

Fixes TIMOB-27403
  • Loading branch information
ewanharris authored and sgtcoolguy committed Sep 17, 2019
1 parent 16f4d19 commit 8ecfb1e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5800,7 +5800,18 @@ iOSBuilder.prototype.copyResources = function copyResources(next) {
},

function generateSemanticColors() {
const colorsFile = path.join(this.projectDir, 'Resources', 'iphone', 'semantic.colors.json');
let colorsFile = path.join(this.projectDir, 'Resources', 'iphone', 'semantic.colors.json');

if (!fs.existsSync(colorsFile)) {
// Fallback to root of Resources folder for Classic applications
colorsFile = path.join(this.projectDir, 'Resources', 'semantic.colors.json');
}

if (!fs.existsSync(colorsFile)) {
this.logger.debug(__('Skipping colorset generation as "semantic.colors.json" file does not exist'));
return;
}

const assetCatalog = path.join(this.buildDir, 'Assets.xcassets');
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;

Expand All @@ -5823,9 +5834,6 @@ iOSBuilder.prototype.copyResources = function copyResources(next) {
} : null;
}

if (!fs.existsSync(colorsFile)) {
return;
}
const colors = fs.readJSONSync(colorsFile);

for (const [ color, colorValue ] of Object.entries(colors)) {
Expand Down

0 comments on commit 8ecfb1e

Please sign in to comment.