Comparing version 0.4.106 to 0.4.107
@@ -716,2 +716,10 @@ "use strict"; | ||
}; | ||
var copyExpoImage = function (cwd, expoDir, appJson, keyPath) { | ||
var imagePath = _.get(appJson, keyPath); | ||
if (imagePath) { | ||
var absImagePath = path.join(cwd, imagePath); | ||
fs.writeFileSync(path.join(expoDir, path.basename(absImagePath)), fs.readFileSync(absImagePath)); | ||
_.set(appJson, keyPath, path.basename(absImagePath)); | ||
} | ||
}; | ||
var setupExpoDir = function (spin, builder, dir, platform) { | ||
@@ -731,7 +739,10 @@ var reactNativeDir = path.join(dir, 'node_modules', 'react-native'); | ||
var appJson = JSON.parse(fs.readFileSync(builder.require.resolve('./app.json')).toString()); | ||
if (appJson.expo.icon) { | ||
var iconPath = path.join(builder.require.cwd, appJson.expo.icon); | ||
fs.writeFileSync(path.join(dir, path.basename(iconPath)), fs.readFileSync(iconPath)); | ||
appJson.expo.icon = path.basename(iconPath); | ||
} | ||
[ | ||
'expo.icon', | ||
'expo.ios.icon', | ||
'expo.android.icon', | ||
'expo.splash.image', | ||
'expo.android.splash.image', | ||
'expo.ios.splash.image' | ||
].forEach(function (keyPath) { return copyExpoImage(builder.require.cwd, dir, appJson, keyPath); }); | ||
fs.writeFileSync(path.join(dir, 'app.json'), JSON.stringify(appJson)); | ||
@@ -738,0 +749,0 @@ if (platform !== 'all') { |
{ | ||
"name": "spinjs", | ||
"version": "0.4.106", | ||
"version": "0.4.107", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -729,2 +729,11 @@ import { exec, spawn } from 'child_process'; | ||
const copyExpoImage = (cwd: string, expoDir: string, appJson: any, keyPath: string) => { | ||
const imagePath: string = _.get(appJson, keyPath); | ||
if (imagePath) { | ||
const absImagePath = path.join(cwd, imagePath); | ||
fs.writeFileSync(path.join(expoDir, path.basename(absImagePath)), fs.readFileSync(absImagePath)); | ||
_.set(appJson, keyPath, path.basename(absImagePath)); | ||
} | ||
}; | ||
const setupExpoDir = (spin: Spin, builder: Builder, dir, platform) => { | ||
@@ -747,7 +756,10 @@ const reactNativeDir = path.join(dir, 'node_modules', 'react-native'); | ||
const appJson = JSON.parse(fs.readFileSync(builder.require.resolve('./app.json')).toString()); | ||
if (appJson.expo.icon) { | ||
const iconPath = path.join(builder.require.cwd, appJson.expo.icon); | ||
fs.writeFileSync(path.join(dir, path.basename(iconPath)), fs.readFileSync(iconPath)); | ||
appJson.expo.icon = path.basename(iconPath); | ||
} | ||
[ | ||
'expo.icon', | ||
'expo.ios.icon', | ||
'expo.android.icon', | ||
'expo.splash.image', | ||
'expo.android.splash.image', | ||
'expo.ios.splash.image' | ||
].forEach(keyPath => copyExpoImage(builder.require.cwd, dir, appJson, keyPath)); | ||
fs.writeFileSync(path.join(dir, 'app.json'), JSON.stringify(appJson)); | ||
@@ -754,0 +766,0 @@ if (platform !== 'all') { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
377622
6222