Skip to content

Commit

Permalink
fix: Still trying to understand testing undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarreno committed Jan 6, 2022
1 parent 10bc3cb commit d29e259
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Unfortunately there are some restrictions:
```yaml
steps:
- uses: actions/checkout@v2
- uses: gcarreno/[email protected].14
- uses: gcarreno/[email protected].15
with:
lazarus-version: "dist"
include-packages: "Synapse 40.1"
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Lazarus
uses: gcarreno/[email protected].14
uses: gcarreno/[email protected].15
with:
lazarus-version: ${{ matrix.lazarus-versions }}
include-packages: "Synapse 40.1"
Expand Down
17 changes: 13 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ class Lazarus {
// There MUST be a better way to do this
var fpcsrc = fs.readdirSync('/Volumes').filter(fn => fn.startsWith('fpcsrc'));
var loc = fs.readdirSync('/Volumes/' + fpcsrc[0]).filter(fn => fn.endsWith('.pkg'));
if (typeof (loc) === undefined || typeof (loc[0]) === undefined) {
if (loc !== undefined && loc[0] !== undefined) {
console.log('loc and loc[0] not undefined');
}
if (loc === undefined || loc[0] === undefined) {
console.log('loc or loc[0] undefined');
loc = fs.readdirSync('/Volumes/' + fpcsrc[0]).filter(fn => fn.endsWith('.mpkg'));
}
Expand Down Expand Up @@ -646,7 +649,10 @@ class Lazarus {
// There MUST be a better way to do this
var fpc = fs.readdirSync('/Volumes').filter(fn => fn.startsWith('fpc'));
var loc = fs.readdirSync('/Volumes/' + fpc[0]).filter(fn => fn.endsWith('.pkg'));
if (typeof (loc) === undefined || typeof (loc[0]) === undefined) {
if (loc !== undefined && loc[0] !== undefined) {
console.log('loc and loc[0] not undefined');
}
if (loc === undefined || loc[0] === undefined) {
console.log('loc or loc[0] undefined');
loc = fs.readdirSync('/Volumes/' + fpc[0]).filter(fn => fn.endsWith('.mpkg'));
}
Expand Down Expand Up @@ -677,7 +683,10 @@ class Lazarus {
// There MUST be a better way to do this
var laz = fs.readdirSync('/Volumes').filter(fn => fn.startsWith('lazarus'));
var loc = fs.readdirSync('/Volumes/' + laz[0]).filter(fn => fn.endsWith('.pkg'));
if (typeof (loc) === undefined || typeof (loc[0]) === undefined) {
if (loc !== undefined && loc[0] !== undefined) {
console.log('loc and loc[0] not undefined');
}
if (loc === undefined || loc[0] === undefined) {
console.log('loc or loc[0] undefined');
loc = fs.readdirSync('/Volumes/' + laz[0]).filter(fn => fn.endsWith('.mpkg'));
}
Expand Down Expand Up @@ -1022,7 +1031,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__webpack_require__(186));
const inst = __importStar(__webpack_require__(981));
const _version = '3.0.14';
const _version = '3.0.15';
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
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": "setup-lazarus",
"version": "3.0.14",
"version": "3.0.15",
"description": "Set up your GitHub Actions workflow with a specific version of Lazarus",
"main": "lib/setup-lazarus.js",
"scripts": {
Expand Down
15 changes: 12 additions & 3 deletions src/Lazarus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,10 @@ export class Lazarus{
// There MUST be a better way to do this
var fpcsrc = fs.readdirSync('/Volumes').filter(fn => fn.startsWith('fpcsrc'));
var loc = fs.readdirSync('/Volumes/'+fpcsrc[0]).filter(fn => fn.endsWith('.pkg'));
if (typeof(loc) === undefined || typeof(loc[0]) === undefined) {
if (loc !== undefined && loc[0] !== undefined) {
console.log('loc and loc[0] not undefined');
}
if (loc === undefined || loc[0] === undefined) {
console.log('loc or loc[0] undefined');
loc = fs.readdirSync('/Volumes/'+fpcsrc[0]).filter(fn => fn.endsWith('.mpkg'));
}
Expand Down Expand Up @@ -536,7 +539,10 @@ export class Lazarus{
// There MUST be a better way to do this
var fpc = fs.readdirSync('/Volumes').filter(fn => fn.startsWith('fpc'));
var loc = fs.readdirSync('/Volumes/'+fpc[0]).filter(fn => fn.endsWith('.pkg'));
if (typeof(loc) === undefined || typeof(loc[0]) === undefined) {
if (loc !== undefined && loc[0] !== undefined) {
console.log('loc and loc[0] not undefined');
}
if (loc === undefined || loc[0] === undefined) {
console.log('loc or loc[0] undefined');
loc = fs.readdirSync('/Volumes/'+fpc[0]).filter(fn => fn.endsWith('.mpkg'));
}
Expand Down Expand Up @@ -570,7 +576,10 @@ export class Lazarus{
// There MUST be a better way to do this
var laz = fs.readdirSync('/Volumes').filter(fn => fn.startsWith('lazarus'));
var loc = fs.readdirSync('/Volumes/'+laz[0]).filter(fn => fn.endsWith('.pkg'));
if (typeof(loc) === undefined || typeof(loc[0]) === undefined) {
if (loc !== undefined && loc[0] !== undefined) {
console.log('loc and loc[0] not undefined');
}
if (loc === undefined || loc[0] === undefined) {
console.log('loc or loc[0] undefined');
loc = fs.readdirSync('/Volumes/'+laz[0]).filter(fn => fn.endsWith('.mpkg'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/setup-lazarus.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as inst from './Installer';

const _version = '3.0.14';
const _version = '3.0.15';

async function run(): Promise<void> {
try {
Expand Down

0 comments on commit d29e259

Please sign in to comment.