Skip to content

Commit b7ac07a

Browse files
Jake Renshawgoff-marocchi
authored andcommitted
format asset tags
1 parent f818f1a commit b7ac07a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/pbxProject.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,7 @@ pbxProject.prototype.removeTargetAttribute = function(prop, target) {
22002200
}
22012201

22022202
pbxProject.prototype.addAssetTag = function(assetTagName, resourcesFolder) {
2203+
assetTagName = sanitiseTag(assetTagName)
22032204
var project = this.getFirstProject()['firstProject'];
22042205
if (project['attributes'] === undefined) {
22052206
project['attributes'] = {};
@@ -2222,6 +2223,14 @@ pbxProject.prototype.addAssetTag = function(assetTagName, resourcesFolder) {
22222223
})
22232224
}
22242225

2226+
function sanitiseTag(tag) {
2227+
return `"${tag}"`
2228+
}
2229+
2230+
function stripQuotes(tag) {
2231+
return tag.replace(/"/g, "")
2232+
}
2233+
22252234
pbxProject.prototype.removeTaggedResourceFiles = function() {
22262235
for (const [ uuid, value ] of Object.entries(this.pbxBuildFileSection())) {
22272236
// console.log(value);
@@ -2247,7 +2256,7 @@ pbxProject.prototype.removeTaggedResourceFiles = function() {
22472256
if (attributes['KnownAssetTags'] == undefined) {
22482257
return []
22492258
}
2250-
return attributes['KnownAssetTags']
2259+
return attributes['KnownAssetTags'].map(stripQuotes)
22512260
}
22522261

22532262
pbxProject.prototype.removeAssetTags = function() {

0 commit comments

Comments
 (0)