Permalink
Browse files

use install.path in options.paths for build

  • Loading branch information...
1 parent d343a30 commit 86e1aeaaa4c8f26d371fb5969cb0f7dae7325bb2 Hsiaoming Yang committed Mar 26, 2013
Showing with 14 additions and 1 deletion.
  1. +14 −1 lib/build.js
View
@@ -1,9 +1,22 @@
var path = require('path');
+var spmrc = require('spmrc');
var grunt = require('./sdk/grunt');
var log = require('./utils/log');
exports = module.exports = function(options) {
- var pkg = grunt.file.readJSON('package.json');
+ options = options || {};
+ var pkgfile = options.pkgfile || 'package.json';
+ var pkg = {};
+ if (grunt.file.exists(pkgfile)) {
+ pkg = grunt.file.readJSON('package.json');
+ }
+
+ var installpath = spmrc.get('install.path');
+ options.paths = [installpath];
+ if (installpath !== 'sea-modules') {
+ options.paths.push('sea-modules');
+ }
+
var scripts = pkg.scripts || {};
if (scripts.build) {
childexec(scripts.build, function() {

0 comments on commit 86e1aea

Please sign in to comment.