This repository was archived by the owner on Jun 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var projectConfig = require ( './../projectConfig' ) ;
4+
5+ /**
6+ * @memberof project
7+ * @method clear
8+ * @description Clear the project configuration settings. Only the project name will remain in the config file.
9+ * @param {function } cb - Node-style error-first callback function
10+ * @returns {object } project config
11+ * @example
12+ * paperspace.project.clear(function(err, resp) {
13+ * // handle error or http response
14+ * });
15+ * @example
16+ * $ paperspace project clear
17+ * @example
18+ * # Note: there is no HTTP request corresponding to 'paperspace project clear'.
19+ * @example
20+ * // Example return value:
21+ * {
22+ * "project": "myproject",
23+ * }
24+ */
25+
26+ function clear ( params , cb ) {
27+ projectConfig . clear ( ) ;
28+ var config = projectConfig . show ( ) ;
29+ return cb ( null , config ) ;
30+ }
31+
32+ module . exports = clear ;
Original file line number Diff line number Diff line change 55 */
66
77module . exports = {
8+ clear : require ( './clear' ) ,
89 init : require ( './init' ) ,
910 show : require ( './show' ) ,
1011} ;
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ function write() {
2727 }
2828}
2929
30+ function clear ( ) {
31+ read ( ) ;
32+ var project = config . project ;
33+ config = { project : project } ;
34+ write ( ) ;
35+ }
36+
3037function getProject ( ) {
3138 read ( ) ;
3239 return config . project ;
@@ -183,5 +190,6 @@ module.exports = {
183190 setWorkspace : setWorkspace ,
184191 getName : getName ,
185192 setName : setName ,
193+ clear : clear ,
186194 show : show ,
187195} ;
You can’t perform that action at this time.
0 commit comments