Skip to content

Commit a12d8b3

Browse files
committedAug 31, 2021
chore: Modify the output log.
1 parent 6dac70b commit a12d8b3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"src"
3737
],
3838
"devDependencies": {
39-
"tsbb": "3.0.0"
39+
"tsbb": "3.0.1"
4040
},
4141
"dependencies": {
4242
"@types/fs-extra": "9.0.12",

‎src/compile.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export default async function compile(dir: string, option: ICompileOtion) {
4545

4646
export async function outputFile(data: IOutputFile, inputDir: string, outputDir: string) {
4747
try {
48-
const logPathIn = data.path.replace(process.cwd(), '');
48+
const logPathIn = path.relative(process.cwd(), data.path);
4949
data.path = data.path.replace(inputDir, outputDir).replace(/.less$/, '.css');
50-
const logPathOut = data.path.replace(process.cwd(), '');
50+
const logPathOut = path.relative(process.cwd(), data.path);
5151
await log(logPathOut, logPathIn);
5252
await fs.outputFile(data.path, data.css);
5353
if (data.imports && data.imports.length > 0) {
@@ -62,8 +62,8 @@ async function log(output: string, input?: string) {
6262
const pkg = await readPkgUp();
6363
const projectName = pkg ? pkg?.packageJson.name : '';
6464
if (input) {
65-
console.log(`♻️ \x1b[32m ${projectName} =>\x1b[0m:`, input, '->', output);
65+
console.log(`♻️ \x1b[32m ${projectName}\x1b[0m:`, input, '>', output);
6666
} else {
67-
console.log(`♻️ \x1b[32m ${projectName} =>\x1b[0m:`, 'Output one file: ->', output);
67+
console.log(`♻️ \x1b[32m ${projectName}\x1b[0m:`, 'Output one file: >', output);
6868
}
6969
}

0 commit comments

Comments
 (0)
Please sign in to comment.