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

Commit2fc1113

Browse files
committed
cleanup output text ui
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentabd46f1 commit2fc1113

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

‎src/utils/exec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ export function createCommandRunner(cwd: string) {
4343
leterrors=[];
4444
for(constcommandofcommands){
4545
try{
46-
console.log(`>${command}`);
46+
console.log(`-->${command}`);
4747
letcwdDir=cwd;
4848
if(dir){
4949
cwdDir=path.join(cwd,dir);
5050
}
5151
const{ stdout, stderr}=awaitcreateExec(cwdDir)(command);
5252

5353
console.warn(stderr);
54-
console.log(stdout);
5554
}catch(e){
5655
console.error(`Command failed: "${command}"`);
5756
console.warn(e.message);

‎src/validate.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ async function validate(args: string[]) {
5858
construnTest=createTestRunner(tmpDir,skeleton.config.testRunner);
5959

6060
// setup
61+
console.info("* Setup");
6162
if(commits.INIT){
6263
// load commits
63-
console.info("Loading setup commits...");
64+
console.info("-- Loading commits...");
6465
awaitcherryPick(commits.INIT);
6566

6667
// run commands
6768
if(skeleton.config?.testRunner?.setup?.commands){
68-
console.info("Running setup commands...");
69+
console.info("-- Running commands...");
6970

7071
awaitrunCommands(
7172
skeleton.config?.testRunner?.setup?.commands,
@@ -76,30 +77,32 @@ async function validate(args: string[]) {
7677
}
7778

7879
for(constlevelofskeleton.levels){
80+
console.info(`*${level.id}`);
7981
if(level?.setup){
8082
// load commits
8183
if(commits[`${level.id}`]){
82-
console.log(`Loading${level.id} commits...`);
84+
console.log(`-- Loading commits...`);
8385
awaitcherryPick(commits[level.id]);
8486
}
8587
// run commands
8688
if(level.setup?.commands){
87-
console.log(`Running${level.id} commands...`);
89+
console.log(`-- Running commands...`);
8890
awaitrunCommands(level.setup.commands);
8991
}
9092
}
9193
// steps
9294
if(level.steps){
9395
for(conststepoflevel.steps){
96+
console.info(`**${step.id}`);
9497
// load commits
9598
conststepSetupCommits=commits[`${step.id}Q`];
9699
if(stepSetupCommits){
97-
console.info(`Loading${step.id} setup commits...`);
100+
console.info(`--- Loading setup commits...`);
98101
awaitcherryPick(stepSetupCommits);
99102
}
100103
// run commands
101104
if(step.setup.commands){
102-
console.info(`Running${step.id} setup commands...`);
105+
console.info(`--- Running setup commands...`);
103106
awaitrunCommands(step.setup.commands);
104107
}
105108

@@ -109,47 +112,49 @@ async function validate(args: string[]) {
109112
// ignore running tests on steps with no solution
110113
if(hasSolution){
111114
// run test
112-
console.info("Running setup test");
115+
console.info("---Running setup test...");
113116
// expect fail
114117
const{ stdout, stderr}=awaitrunTest();
115118
if(stdout){
116119
console.error(
117-
`Expected${step.id} setup tests to fail, but passed`
120+
`---Expected${step.id} setup tests to fail, but passed`
118121
);
122+
// log tests
119123
console.log(stdout);
120124
}
121125
}
122126

123127
if(stepSolutionCommits){
124-
console.info(`Loading${step.id} solution commits...`);
128+
console.info(`--- Loading solution commits...`);
125129
awaitcherryPick(stepSolutionCommits);
126130
}
127131

128132
// run commands
129133
if(step?.solution?.commands){
130-
console.info(`Running${step.id} solution commands...`);
134+
console.info(`--- Running solution commands...`);
131135
awaitrunCommands(step.solution.commands);
132136
}
133137

134138
if(hasSolution){
135139
// run test
136-
console.info("Running solution test");
140+
console.info("---Running solution test...");
137141
// expect pass
138142
const{ stdout, stderr}=awaitrunTest();
139143
if(stderr){
140144
console.error(
141-
`Expected${step.id} solution tests to pass, but failed`
145+
`---Expected${step.id} solution tests to pass, but failed`
142146
);
147+
// log tests
143148
console.log(stderr);
144149
}
145150
}
146151
}
147152
}
148153
}
149154

150-
// log level/step
151-
// on error, show level/step & error message
155+
console.info(`\n✔ Success!`);
152156
}catch(e){
157+
console.error("\n✘ Fail!");
153158
console.error(e.message);
154159
}finally{
155160
// cleanup

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp