Skip to content

Commit

Permalink
Fixed build action
Browse files Browse the repository at this point in the history
  • Loading branch information
CGandGameEngineLearner committed Mar 5, 2024
1 parent 45f8600 commit 99265e2
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 6 deletions.
1 change: 0 additions & 1 deletion dev_tools/scripts/generateKeys.js.map

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions devlop_tools/generateKeys.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/CSVimporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class CSVimporter
i++;
})
.on('end', () => {
vscode.window.showInformationMessage("全部导入成功");
vscode.window.showInformationMessage("全部成功");
; console.log('Parsed CSV data Length:', i);
})
.on('error', (error) => {
Expand Down
27 changes: 26 additions & 1 deletion src/templateGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,38 @@ import * as vscode from 'vscode';
const fs = require('fs-extra');
import { Env } from './env';
import * as path from 'path';
import { isInDirectory, isFileValid, isPathValid, removeSpacesAndNewlines, toUnicodeIgnoreASCII } from './utility';
export class TemplateGenerator{
private env: Env;
public constructor(env: Env) {
this.env = env;
}

public static async askUserTargetUri(): Promise<vscode.Uri | undefined> {

// 询问用户得到目标文件夹
while (true) {
let selectedFiles = await vscode.window.showOpenDialog({
canSelectFolders: true,
openLabel: '选择文件夹'
});
let selectedExe = selectedFiles?.[0];
if (!selectedExe) {
return undefined;
}
if (await isPathValid(selectedExe.fsPath)) {
return selectedExe;
}
}
}

private copyTemplateToTargetPath(templateType: string, targetPath: vscode.Uri): boolean{
/**
* 选择类型,生成CSV文件模板
* @param templateType 模板种类
* @param targetPath 目标路径
* @returns true or false 生成成功或失败
*/
public generateTemplateCSVToTargetPath(templateType: string, targetPath: vscode.Uri): boolean{
try {
fs.copy(path.join(path.join(__dirname, "../csv_template"), templateType), targetPath.fsPath);
}
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
}
},
"include": [
"devlop_tools/*.ts"
]
}

0 comments on commit 99265e2

Please sign in to comment.