You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dp...@apache.org on 2019/06/11 15:37:55 UTC

[cordova-common] branch master updated: (ios) Plist document not indented with tabs

This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-common.git


The following commit(s) were added to refs/heads/master by this push:
     new 8440f18  (ios) Plist document not indented with tabs
8440f18 is described below

commit 8440f1874bb7017c3566ed4e252bd12eec38822b
Author: Oliver Salzburg <ol...@gmail.com>
AuthorDate: Thu May 9 01:26:12 2019 +0200

    (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.
---
 spec/ConfigChanges/ConfigChanges.spec.js                          | 2 +-
 .../projects/ios-config-xml/SampleApp/SampleApp-Info.plist        | 8 ++++----
 src/ConfigChanges/ConfigFile.js                                   | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/spec/ConfigChanges/ConfigChanges.spec.js b/spec/ConfigChanges/ConfigChanges.spec.js
index 657ccf8..e76eab8 100644
--- a/spec/ConfigChanges/ConfigChanges.spec.js
+++ b/spec/ConfigChanges/ConfigChanges.spec.js
@@ -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);
diff --git a/spec/fixtures/projects/ios-config-xml/SampleApp/SampleApp-Info.plist b/spec/fixtures/projects/ios-config-xml/SampleApp/SampleApp-Info.plist
index 22edad6..5ede567 100644
--- a/spec/fixtures/projects/ios-config-xml/SampleApp/SampleApp-Info.plist
+++ b/spec/fixtures/projects/ios-config-xml/SampleApp/SampleApp-Info.plist
@@ -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/>
diff --git a/src/ConfigChanges/ConfigFile.js b/src/ConfigChanges/ConfigFile.js
index 151e9b0..be8f78e 100644
--- a/src/ConfigChanges/ConfigFile.js
+++ b/src/ConfigChanges/ConfigFile.js
@@ -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;
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org