This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added hook and resource file to copy GoogleService-Info.plist
- Loading branch information
1 parent
a18d503
commit 8d44ccf
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
var fs = require('fs'); | ||
|
||
var getValue = function(config, name) { | ||
var value = config.match(new RegExp('<' + name + '>(.*?)</' + name + '>', "i")) | ||
if(value && value[1]) { | ||
return value[1] | ||
} else { | ||
return null | ||
} | ||
} | ||
|
||
function fileExists(path) { | ||
try { | ||
return fs.statSync(path).isFile(); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
function directoryExists(path) { | ||
try { | ||
return fs.statSync(path).isDirectory(); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
var config = fs.readFileSync("config.xml").toString(); | ||
var name = getValue(config, "name"); | ||
|
||
if(fileExists("GoogleService-Info.plist") && directoryExists("platforms/ios/")){ | ||
try { | ||
var contents = fs.readFileSync("GoogleService-Info.plist").toString(); | ||
fs.writeFileSync("platforms/ios/" + name + "/Resources/GoogleService-Info.plist", contents); | ||
} catch(err) { | ||
process.stdout.write(err); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
</dict> | ||
</plist> |