Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Commit

Permalink
closes #763
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptPilot authored and scriptPilot committed Jan 10, 2018
1 parent 6f84f01 commit a387c4b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@
## Next version ## Next version


### New features

- [x] [#763 - Allow debug mode for App Framework](https://github.com/scriptPilot/app-framework/issues/763)

### Bug-fixes ### Bug-fixes


- [x] [#743 - Update framework7-vue to v0.9.4](https://github.com/scriptPilot/app-framework/issues/743) - [x] [#743 - Update framework7-vue to v0.9.4](https://github.com/scriptPilot/app-framework/issues/743)
Expand Down
4 changes: 4 additions & 0 deletions config-scheme.json
Expand Up @@ -233,5 +233,9 @@
}, },
"npmignore": { "npmignore": {
"type": "object" "type": "object"
},
"debug": {
"type": "boolean",
"default": false
} }
} }
3 changes: 2 additions & 1 deletion demo/config.json
Expand Up @@ -76,5 +76,6 @@
"fixCodeOnBuild": true, "fixCodeOnBuild": true,
"devServerPort": "8080", "devServerPort": "8080",
"gitignore": {}, "gitignore": {},
"npmignore": {} "npmignore": {},
"debug": false
} }
3 changes: 3 additions & 0 deletions docs/configuration.md
Expand Up @@ -68,4 +68,7 @@ eslint | *object* |
fixCodeOnTest | *boolean* | true fixCodeOnTest | *boolean* | true
fixCodeOnBuild | *boolean* | true fixCodeOnBuild | *boolean* | true
devServerPort | /^[0-9]{4}$/ | 8080 devServerPort | /^[0-9]{4}$/ | 8080
gitignore | *object* | {}
npmignore | *object* | {}
debug | *boolean* | false
<!-- /config-options --> <!-- /config-options -->
14 changes: 13 additions & 1 deletion scripts/env.js
Expand Up @@ -121,6 +121,17 @@ let ignored = function (path) {
return isIgnored return isIgnored
} }


// Debug function
const debug = (input) => {
if (cfg.debug === true) {
const inputString = typeof input === 'string' ? input : JSON.stringify(input)
const debugFile = abs(proj, 'debug.log')
let debugFileContent = found(debugFile) ? fs.readFileSync(debugFile, 'utf-8') : ''
debugFileContent = debugFileContent + inputString + '\n'
fs.writeFileSync(debugFile, debugFileContent)
}
}

module.exports = { module.exports = {
framework: framework, framework: framework,
arg: arg, arg: arg,
Expand All @@ -131,5 +142,6 @@ module.exports = {
pkg: pkg, pkg: pkg,
cfg: cfg, cfg: cfg,
os: os, os: os,
ignored: ignored ignored: ignored,
debug: debug
} }

0 comments on commit a387c4b

Please sign in to comment.