Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d5c7c22

Browse files
author
Danilo De Luca
committed
Fix bug on iOS platform occurring when application is built in release mode with development environment. In this case, before this patch, the plugin copies firebase prod file in place of the firebase dev file.
1 parent d008d70 commit d5c7c22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

publish/scripts/installer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,16 +837,19 @@ module.exports = function($logger, hookArgs) {
837837
838838
var isReleaseBuild = !!((hookArgs.checkForChangesOpts && hookArgs.checkForChangesOpts.projectChangesOptions) || hookArgs.prepareData).release;
839839
var validProdEnvs = ['prod','production'];
840+
var validStagingEnvs = ["dev", "development", "staging"];
841+
var isStagingEnv = false;
840842
var isProdEnv = false; // building with --env.prod or --env.production flag
841843
842844
var env = ((hookArgs.checkForChangesOpts && hookArgs.checkForChangesOpts.projectData && hookArgs.checkForChangesOpts.projectData.$options && hookArgs.checkForChangesOpts.projectData.$options.argv) || hookArgs.prepareData).env;
843845
if (env) {
844846
Object.keys(env).forEach((key) => {
845847
if (validProdEnvs.indexOf(key)>-1) { isProdEnv=true; }
848+
if (validStagingEnvs.indexOf(key) > -1) { isStagingEnv = true; }
846849
});
847850
}
848851
849-
var buildType = isReleaseBuild || isProdEnv ? 'production' : 'development';
852+
var buildType = (isReleaseBuild && !isStagingEnv) || isProdEnv ? 'production' : 'development';
850853
851854
/*
852855
Detect if we have nativescript-plugin-firebase temp file created during after-prepare hook, so we know

0 commit comments

Comments
 (0)