Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/alibaba/Thera
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
  • Loading branch information
NickolasHu committed Mar 30, 2017
2 parents a44e3d6 + 1479571 commit ce4bbc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
"linter": "git+https://github.com/TheraPackages/linter.git#v1.0.8",
"autocomplete-weex": "git+https://github.com/TheraPackages/autocomplete-weex.git",
"atom-notifier": "git+https://github.com/TheraPackages/notifier.git#v0.5.3",
"weex-run": "git+https://github.com/TheraPackages/weex-run.git#v1.1.14"
"weex-run": "git+https://github.com/TheraPackages/weex-run.git#v1.1.14",
"atom-beautify": "git+https://github.com/TheraPackages/atom-beautify.git#v0.29.19"
},
"standard": {
"ignore": [],
Expand Down
12 changes: 7 additions & 5 deletions script/lib/package-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ function installAttachPackages (packagedAppPath, bundledResourcesPath) {

function copyResourceInPackage (packagedAppPath, bundledResourcesPath) {
console.log('copyResourceInPackage')
findAndMoveResourceInPackage(path.join(CONFIG.repositoryRootPath, 'node_modules', '*', 'package.json'), bundledResourcesPath)
findAndMoveResourceInPackage(path.join(bundledResourcesPath, 'attach-package', '*', 'package.json'), bundledResourcesPath)
findAndMoveResourceInPackage(path.join(CONFIG.repositoryRootPath, 'node_modules', '*', 'package.json'), bundledResourcesPath, false)
findAndMoveResourceInPackage(path.join(bundledResourcesPath, 'attach-package', '*', 'package.json'), bundledResourcesPath, true)
}

function findAndMoveResourceInPackage (searchPath, bundledResourcesPath) {
function findAndMoveResourceInPackage (searchPath, bundledResourcesPath, remove) {
glob.sync(searchPath)
.map((packagePath) => {
return {
Expand All @@ -155,8 +155,10 @@ function findAndMoveResourceInPackage (searchPath, bundledResourcesPath) {
let toPath = path.join(bundledResourcesPath, 'attach-resources', dirName, info.obj.attachResource)
console.log(`copy ${fromPath} to ${toPath}`)
fs.copySync(fromPath, toPath, {recursive: true})
console.log(`remove ${fromPath}`)
fs.removeSync(fromPath)
if (remove) {
console.log(`remove ${fromPath}`)
fs.removeSync(fromPath)
}
})
}

Expand Down

0 comments on commit ce4bbc4

Please sign in to comment.