File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Storage from './services/storage'
66import tutorialConfig from './actions/tutorialConfig'
77import setupActions from './actions/setupActions'
88import solutionActions from './actions/solutionActions'
9+ import saveCommit from './actions/saveCommit'
910
1011
1112interface Channel {
@@ -165,6 +166,7 @@ class Channel implements Channel {
165166 this . stepProgress . update ( {
166167 [ action . payload . stepId ] : true
167168 } )
169+ saveCommit ( )
168170 }
169171
170172 const success = await this . postMessage ( action )
Original file line number Diff line number Diff line change 1+ import * as git from '../services/git'
2+
3+ async function saveCommit ( ) {
4+ console . log ( 'committing progress' )
5+ git . saveCommit ( 'Save progress' )
6+ }
7+
8+ export default saveCommit
Original file line number Diff line number Diff line change @@ -47,9 +47,8 @@ export function loadCommit(commit: string): Promise<void> {
4747 git commit -am '${level}/${stage}/${step} complete'
4848*/
4949
50- export async function saveCommit ( position : CR . Position ) : Promise < void > {
51- const { levelId, stageId, stepId} = position
52- const { stdout, stderr} = await node . exec ( `git commit -am 'completed ${ levelId } /${ stageId } /${ stepId } '` )
50+ export async function saveCommit ( message : string ) : Promise < void > {
51+ const { stdout, stderr} = await node . exec ( `git commit -am '${ message } '` )
5352 if ( stderr ) {
5453 console . error ( stderr )
5554 throw new Error ( 'Error saving progress to Git' )
You can’t perform that action at this time.
0 commit comments