diff --git a/dist/resource-translator/index.js b/dist/resource-translator/index.js index 7e9a1ad..f9e1cee 100644 --- a/dist/resource-translator/index.js +++ b/dist/resource-translator/index.js @@ -5319,8 +5319,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.writeFile = exports.buildXml = exports.applyTranslations = exports.readFile = void 0; const xml2js_1 = __webpack_require__(992); const fs_1 = __webpack_require__(747); +const url_1 = __webpack_require__(835); async function readFile(path) { - const file = fs_1.readFileSync(path, 'utf-8'); + const url = url_1.pathToFileURL(path); + const file = fs_1.readFileSync(url, 'utf-8'); return await parseXml(file); } exports.readFile = readFile; @@ -13748,6 +13750,9 @@ exports.findAllResourceFiles = void 0; const glob_1 = __webpack_require__(281); const io_util_1 = __webpack_require__(672); async function findAllResourceFiles(baseFileGlob) { + // TODO: consider... + // import { context } from '@actions/github'; + // const octokit = await context.getOctokit(); const globber = await glob_1.create(baseFileGlob); const filesAndDirectories = await globber.glob(); return filesAndDirectories.filter(async (path) => { diff --git a/package.json b/package.json index c6c6d36..4797a0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ievangelist/resource-translator", - "version": "0.2.0", + "version": "0.3.0", "preview": true, "keywords": [ "github", diff --git a/src/resource-finder.ts b/src/resource-finder.ts index 2d6a549..737f648 100644 --- a/src/resource-finder.ts +++ b/src/resource-finder.ts @@ -2,6 +2,10 @@ import { create } from '@actions/glob'; import { isDirectory } from '@actions/io/lib/io-util'; export async function findAllResourceFiles(baseFileGlob: string): Promise { + // TODO: consider... + // import { context } from '@actions/github'; + // const octokit = await context.getOctokit(); + const globber = await create(baseFileGlob); const filesAndDirectories = await globber.glob(); diff --git a/src/resource-io.ts b/src/resource-io.ts index 35dff76..5a7e3a3 100644 --- a/src/resource-io.ts +++ b/src/resource-io.ts @@ -1,10 +1,12 @@ import { Builder, Parser } from 'xml2js'; import { readFileSync, writeFileSync } from 'fs'; +import { pathToFileURL } from 'url'; import { ResourceFile } from './resource-file'; import { Result } from './translation-results'; export async function readFile(path: string) { - const file = readFileSync(path, 'utf-8'); + const url = pathToFileURL(path); + const file = readFileSync(url, 'utf-8'); return await parseXml(file); }