@@ -49,7 +49,6 @@ function setLastJobId(project, jobId) {
4949 }
5050}
5151
52-
5352function removeLastJobId ( jobId ) {
5453 if ( jobId ) {
5554 read ( ) ;
@@ -60,6 +59,108 @@ function removeLastJobId(jobId) {
6059 }
6160}
6261
62+ function getContainer ( project , container ) {
63+ if ( ! project && ! container ) {
64+ read ( ) ;
65+ return config . container ;
66+ }
67+ return container ;
68+ }
69+
70+ function setContainer ( project , container ) {
71+ if ( container ) {
72+ if ( ( ! project || config . project === project ) && config . container !== container ) {
73+ config . container = container ;
74+ write ( ) ;
75+ }
76+ }
77+ }
78+
79+ function getMachineType ( project , machineType ) {
80+ if ( ! project && ! machineType ) {
81+ read ( ) ;
82+ return config . machineType ;
83+ }
84+ return machineType ;
85+ }
86+
87+ function setMachineType ( project , machineType ) {
88+ if ( machineType ) {
89+ if ( ( ! project || config . project === project ) && config . machineType !== machineType ) {
90+ config . machineType = machineType ;
91+ write ( ) ;
92+ }
93+ }
94+ }
95+
96+ function getCommand ( project , command ) {
97+ if ( ! project && ! command ) {
98+ read ( ) ;
99+ return config . command ;
100+ }
101+ return command ;
102+ }
103+
104+ function setCommand ( project , command ) {
105+ if ( command ) {
106+ if ( ( ! project || config . project === project ) && config . command !== command ) {
107+ config . command = command ;
108+ write ( ) ;
109+ }
110+ }
111+ }
112+
113+ function getWorkspace ( project , workspace ) {
114+ if ( ! project && ! workspace ) {
115+ read ( ) ;
116+ return config . workspace ;
117+ }
118+ return workspace ;
119+ }
120+
121+ function setWorkspace ( project , workspace ) {
122+ if ( workspace ) {
123+ if ( ( ! project || config . project === project ) && config . workspace !== workspace ) {
124+ config . workspace = workspace ;
125+ write ( ) ;
126+ }
127+ }
128+ }
129+
130+ function getDataset ( project , dataset ) {
131+ if ( ! project && ! dataset ) {
132+ read ( ) ;
133+ return config . dataset ;
134+ }
135+ return dataset ;
136+ }
137+
138+ function setDataset ( project , dataset ) {
139+ if ( dataset ) {
140+ if ( ( ! project || config . project === project ) && config . dataset !== dataset ) {
141+ config . dataset = dataset ;
142+ write ( ) ;
143+ }
144+ }
145+ }
146+
147+ function getName ( project , name ) {
148+ if ( ! project && ! name ) {
149+ read ( ) ;
150+ return config . name ;
151+ }
152+ return name ;
153+ }
154+
155+ function setName ( project , name ) {
156+ if ( name ) {
157+ if ( ( ! project || config . project === project ) && config . name !== name ) {
158+ config . name = name ;
159+ write ( ) ;
160+ }
161+ }
162+ }
163+
63164function show ( ) {
64165 read ( ) ;
65166 return config ;
@@ -70,5 +171,17 @@ module.exports = {
70171 getLastJobId : getLastJobId ,
71172 setLastJobId : setLastJobId ,
72173 removeLastJobId : removeLastJobId ,
174+ getContainer : getContainer ,
175+ setContainer : setContainer ,
176+ getMachineType : getMachineType ,
177+ setMachineType : setMachineType ,
178+ getCommand : getCommand ,
179+ setCommand : setCommand ,
180+ getDataset : getDataset ,
181+ setDataset : setDataset ,
182+ getWorkspace : getWorkspace ,
183+ setWorkspace : setWorkspace ,
184+ getName : getName ,
185+ setName : setName ,
73186 show : show ,
74187} ;
0 commit comments