Skip to content

Commit

Permalink
Updates to GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Nov 2, 2020
1 parent 3e6a592 commit 7e1eee3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion dist/resource-translator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ievangelist/resource-translator",
"version": "0.2.0",
"version": "0.3.0",
"preview": true,
"keywords": [
"github",
Expand Down
4 changes: 4 additions & 0 deletions src/resource-finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { create } from '@actions/glob';
import { isDirectory } from '@actions/io/lib/io-util';

export async function findAllResourceFiles(baseFileGlob: string): Promise<string[]> {
// TODO: consider...
// import { context } from '@actions/github';
// const octokit = await context.getOctokit();

const globber = await create(baseFileGlob);
const filesAndDirectories = await globber.glob();

Expand Down
4 changes: 3 additions & 1 deletion src/resource-io.ts
Original file line number Diff line number Diff line change
@@ -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);
}

Expand Down

0 comments on commit 7e1eee3

Please sign in to comment.