Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita54f1d5

Browse files
committed
save commit on successful test
1 parent33d854c commita54f1d5

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎src/Channel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Storage from './services/storage'
66
importtutorialConfigfrom'./actions/tutorialConfig'
77
importsetupActionsfrom'./actions/setupActions'
88
importsolutionActionsfrom'./actions/solutionActions'
9+
importsaveCommitfrom'./actions/saveCommit'
910

1011

1112
interfaceChannel{
@@ -165,6 +166,7 @@ class Channel implements Channel {
165166
this.stepProgress.update({
166167
[action.payload.stepId]:true
167168
})
169+
saveCommit()
168170
}
169171

170172
constsuccess=awaitthis.postMessage(action)

‎src/actions/saveCommit.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import*asgitfrom'../services/git'
2+
3+
asyncfunctionsaveCommit(){
4+
console.log('committing progress')
5+
git.saveCommit('Save progress')
6+
}
7+
8+
exportdefaultsaveCommit

‎src/services/git/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ export function loadCommit(commit: string): Promise<void> {
4747
git commit -am '${level}/${stage}/${step} complete'
4848
*/
4949

50-
exportasyncfunctionsaveCommit(position:CR.Position):Promise<void>{
51-
const{levelId, stageId, stepId}=position
52-
const{stdout, stderr}=awaitnode.exec(`git commit -am 'completed${levelId}/${stageId}/${stepId}'`)
50+
exportasyncfunctionsaveCommit(message:string):Promise<void>{
51+
const{stdout, stderr}=awaitnode.exec(`git commit -am '${message}'`)
5352
if(stderr){
5453
console.error(stderr)
5554
thrownewError('Error saving progress to Git')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp