Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

fix(ns-bundle): allow installing snapshot artefacts when using env.snapshot #261

Merged
merged 1 commit into from
Aug 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions bin/ns-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ const escapeWithQuotes = arg => `"${arg}"`;
const isTnsCommand = flag => flag.endsWith("-app");
const isEnvCommand = flag => flag.indexOf("env.") > -1;
const shouldUglify = () => process.env.npm_config_uglify;
const shouldSnapshot = platform => platform == "android" &&
require("os").type() != "Windows_NT" &&
process.env.npm_config_snapshot;

const platformSupportsSnapshot = platform => platform === "android";
const osSupportsSnapshot = () => require("os").type() != "Windows_NT";
const snapshotOption = env =>
process.env.npm_config_snapshot || (env && env.snapshot);

const shouldSnapshot = (platform, env) =>
platformSupportsSnapshot(platform) &&
osSupportsSnapshot() &&
snapshotOption(env);

const npmArgs = JSON.parse(process.env.npm_config_argv).original;
const tnsArgs = getTnsArgs(npmArgs);
Expand Down