| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2a0eaf6 commit b8da140
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,12 @@ module.exports = function (hookArgs) { | |||
| 12 | 12 | release: hookArgs.prepareData.release | |
| 13 | 13 | }; | |
| 14 | 14 | ||
| 15 | - if (env.snapshot && shouldSnapshot(shouldSnapshotOptions)) { | ||
| 15 | + if (env.snapshot && | ||
| 16 | + shouldSnapshot(shouldSnapshotOptions) && | ||
| 17 | + (!hookArgs.prepareData || | ||
| 18 | + !hookArgs.prepareData.nativePrepare || | ||
| 19 | + !hookArgs.prepareData.nativePrepare.skipNativePrepare)) { | ||
| 20 | + | ||
| 16 | 21 | installSnapshotArtefacts(hookArgs.prepareData.projectDir); | |
| 17 | 22 | } | |
| 18 | 23 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | 1 | const os = require("os"); | |
| 2 | + const { dirname } = require("path"); | ||
| 3 | + const { existsSync, mkdirSync } = require("fs"); | ||
| 2 | 4 | const { isAndroid } = require("../projectHelpers"); | |
| 3 | 5 | ||
| 4 | 6 | function shouldSnapshot(config) { | |
@@ -21,9 +23,19 @@ function warn(message) { | |||
| 21 | 23 | } | |
| 22 | 24 | } | |
| 23 | 25 | ||
| 26 | + function ensureDirectoryExistence(filePath) { | ||
| 27 | + var dir = dirname(filePath); | ||
| 28 | + if (existsSync(dir)) { | ||
| 29 | + return true; | ||
| 30 | + } | ||
| 31 | + ensureDirectoryExistence(dir); | ||
| 32 | + mkdirSync(dir); | ||
| 33 | + } | ||
| 34 | + | ||
| 24 | 35 | module.exports = { | |
| 25 | 36 | shouldSnapshot, | |
| 26 | 37 | convertToUnixPath, | |
| 27 | 38 | isWinOS, | |
| 28 | - warn | ||
| 39 | + warn, | ||
| 40 | + ensureDirectoryExistence | ||
| 29 | 41 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | - const { relative, resolve, join, dirname } = require("path"); | ||
| 2 | - const { closeSync, openSync, writeFileSync, existsSync, mkdirSync } = require("fs"); | ||
| 1 | + const { relative, resolve, join } = require("path"); | ||
| 2 | + const { closeSync, openSync, writeFileSync } = require("fs"); | ||
| 3 | 3 | const validateOptions = require("schema-utils"); | |
| 4 | 4 | ||
| 5 | 5 | const ProjectSnapshotGenerator = require("../../snapshot/android/project-snapshot-generator"); | |
@@ -8,6 +8,7 @@ const { | |||
| 8 | 8 | ANDROID_PROJECT_DIR, | |
| 9 | 9 | ANDROID_APP_PATH, | |
| 10 | 10 | } = require("../../androidProjectHelpers"); | |
| 11 | + const { ensureDirectoryExistence } = require("../../lib/utils"); | ||
| 11 | 12 | const schema = require("./options.json"); | |
| 12 | 13 | ||
| 13 | 14 | const SNAPSHOT_ENTRY_NAME = "snapshot-entry"; | |
@@ -69,16 +70,6 @@ exports.NativeScriptSnapshotPlugin = (function () { | |||
| 69 | 70 | // ensure that the runtime is installed only in the snapshotted chunk | |
| 70 | 71 | webpackConfig.optimization.runtimeChunk = { name: SNAPSHOT_ENTRY_NAME }; | |
| 71 | 72 | } | |
| 72 | - | ||
| 73 | - function ensureDirectoryExistence(filePath) { | ||
| 74 | - var dir = dirname(filePath); | ||
| 75 | - if (existsSync(dir)) { | ||
| 76 | - return true; | ||
| 77 | - } | ||
| 78 | - ensureDirectoryExistence(dir); | ||
| 79 | - mkdirSync(dir); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | 73 | NativeScriptSnapshotPlugin.getInternalRequireModules = function (webpackContext) { | |
| 83 | 74 | const packageJson = getPackageJson(webpackContext); | |
| 84 | 75 | return (packageJson && packageJson["android"] && packageJson["android"]["requireModules"]) || []; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments