Skip to content
Permalink
Browse files
(ios) Plist document not indented with tabs
Xcode indents .plist documents with tabs, not spaces. Other parts of
Cordova already use tabs for indenting .plist documents and using spaces
directly conflicts with both cases.
  • Loading branch information
oliversalzburg authored and dpogue committed Jun 11, 2019
1 parent 49a0d69 commit 8440f1874bb7017c3566ed4e252bd12eec38822b
Showing 3 changed files with 6 additions and 6 deletions.
@@ -495,7 +495,7 @@ describe('config-changes module', function () {
var platformJson = PlatformJson.load(plugins_dir, 'ios');
platformJson.addInstalledPluginToPrepareQueue('com.adobe.vars', {});
configChanges.process(plugins_dir, temp, 'ios', platformJson, pluginInfoProvider);
expect(fs.readFileSync(path.join(temp, 'SampleApp', 'SampleApp-Info.plist'), 'utf-8')).toMatch(/<key>APluginNode<\/key>\n {4}<string\/>/m);
expect(fs.readFileSync(path.join(temp, 'SampleApp', 'SampleApp-Info.plist'), 'utf-8')).toMatch(/<key>APluginNode<\/key>\n\t<string\/>/m);
});
it('Test 024 : should merge dictionaries and arrays, removing duplicates', function () {
fs.copySync(ios_config_xml, temp);
@@ -28,10 +28,10 @@
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon.png</string>
<string>icon@2x.png</string>
<string>icon-72.png</string>
<string>icon-72@2x.png</string>
<string>icon.png</string>
<string>icon@2x.png</string>
<string>icon-72.png</string>
<string>icon-72@2x.png</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
@@ -94,7 +94,7 @@ ConfigFile.prototype.save = function ConfigFile_save () {
} else {
// plist
var regExp = new RegExp('<string>[ \t\r\n]+?</string>', 'g');
fs.writeFileSync(self.filepath, modules.plist.build(self.data).replace(regExp, '<string></string>'));
fs.writeFileSync(self.filepath, modules.plist.build(self.data, { indent: '\t', offset: -1 }).replace(regExp, '<string></string>'));
}
self.is_changed = false;
};

0 comments on commit 8440f18

Please sign in to comment.