chore(dotnet): fix generating from parent directory (#6095)

This commit is contained in:
Anže Vodovnik 2021-04-07 17:17:57 +02:00 committed by GitHub
parent ee44fbe2bc
commit b37116d7b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ const customTypeNames = new Map([
]);
{
const typesDir = process.argv[2] || '../generate_types/csharp/';
const typesDir = process.argv[2] || path.join(__dirname, 'generate_types', 'csharp');
let checkAndMakeDir = (path) => {
if (!fs.existsSync(path))
fs.mkdirSync(path, { recursive: true });
@ -78,7 +78,7 @@ const customTypeNames = new Map([
});
// get the template for a class
const template = fs.readFileSync("./templates/interface.cs", 'utf-8')
const template = fs.readFileSync(path.join(__dirname, 'templates', 'interface.cs'), 'utf-8')
.replace('[PW_TOOL_VERSION]', `${__filename.substring(path.join(__dirname, '..', '..').length).split(path.sep).join(path.posix.sep)}`);
// we have some "predefined" types, like the mixed state enum, that we can map in advance