This repository has been archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change "foundation build" command to run "npm run build"
- Loading branch information
Showing
2 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
var fs = require('fs'); | ||
var npm = require('npm'); | ||
var path = require('path'); | ||
|
||
module.exports = function(args, options) { | ||
this.watch(args, options, true) | ||
} | ||
// Check if the user is inside a project folder, by looking for a package.json | ||
if (!fs.existsSync(path.join(process.cwd(), 'package.json'))) { | ||
console.log("\nYou don't appear to be in a Foundation project folder.\n\nUse " + "pwd".cyan + " (or " + "chdir".cyan + " on Windows) to see what folder you're in.\n"); | ||
process.exit(0); | ||
} | ||
|
||
var args = ['build']; | ||
|
||
npm.load({ prefix: process.cwd(), loaded: false }, function(err) { | ||
npm.commands['run-script'].apply(this, [args]); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters