Skip to content

Commit ac21789

Browse files
committed
Fix build.ninja not found
1 parent 65de025 commit ac21789

File tree

2 files changed

+2
-51
lines changed

2 files changed

+2
-51
lines changed

dist/index.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -975,13 +975,12 @@ const exec = __importStar(__webpack_require__(986));
975975
const io = __importStar(__webpack_require__(1));
976976
const path = __importStar(__webpack_require__(622));
977977
const fs = __importStar(__webpack_require__(747));
978-
// var hasbin = require('hasbin');
979978
const NINJA = 'ninja';
980979
const MESON = 'meson';
981980
const PYTHON = 'python';
982981
const CLANG_TIDY = 'clang-tidy';
983982
const GCOVR = 'gcovr';
984-
const NINJA_FILE = 'ninja.build';
983+
const NINJA_FILE = 'build.ninja';
985984
const ACTION = 'action';
986985
const BUILD = 'build';
987986
const INSTALL = 'install';
@@ -1086,12 +1085,6 @@ function findPython() {
10861085
if (python.length < 1)
10871086
throw new Error('Python could not be found');
10881087
core.debug('Found Python using which');
1089-
// if (hasbin.sync(PYTHON)) {
1090-
// core.debug('Found Python in the path');
1091-
// python = PYTHON;
1092-
// } else {
1093-
// throw new Error('Python could not be found');
1094-
// }
10951088
}
10961089
pythonCache = python;
10971090
return python;
@@ -1100,10 +1093,6 @@ function findPython() {
11001093
function findNinja() {
11011094
return __awaiter(this, void 0, void 0, function* () {
11021095
core.debug('Checking for Ninja...');
1103-
// if (hasbin.sync(NINJA)) {
1104-
// core.debug('Found Ninja in the path')
1105-
// return;
1106-
// }
11071096
try {
11081097
const ninja = yield io.which(NINJA);
11091098
if (ninja.length < 1)
@@ -1125,11 +1114,6 @@ function findNinja() {
11251114
function findMeson() {
11261115
return __awaiter(this, void 0, void 0, function* () {
11271116
core.debug('Checking for Meson...');
1128-
// await checkNinja();
1129-
// if (hasbin.sync(MESON)) {
1130-
// core.debug('Found Meson in the path');
1131-
// return;
1132-
// }
11331117
try {
11341118
const meson = yield io.which(MESON);
11351119
if (meson.length < 1)
@@ -1151,10 +1135,6 @@ function findMeson() {
11511135
function findCoverage() {
11521136
return __awaiter(this, void 0, void 0, function* () {
11531137
core.debug(`Checking for ${COVERAGE}`);
1154-
// if (hasbin.sync(GCOVR)) {
1155-
// core.debug('Found gcovr in the path');
1156-
// return;
1157-
// }
11581138
try {
11591139
const gcovr = yield io.which(GCOVR);
11601140
if (gcovr.length < 1)
@@ -1180,8 +1160,6 @@ function findTidy() {
11801160
if (tidy.length < 1)
11811161
throw new Error('Clang-tidy must be installed to run it');
11821162
return tidy;
1183-
// if (!hasbin.sync(CLANG_TIDY))
1184-
// throw new Error('Clang-tidy must be installed to run it');
11851163
});
11861164
}
11871165
function run() {

src/main.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import * as io from '@actions/io';
44
import * as path from 'path';
55
import * as fs from 'fs';
66

7-
// var hasbin = require('hasbin');
8-
97
const NINJA: string = 'ninja';
108
const MESON: string = 'meson';
119
const PYTHON: string = 'python';
1210
const CLANG_TIDY: string = 'clang-tidy';
1311
const GCOVR: string = 'gcovr'
1412

15-
const NINJA_FILE: string = 'ninja.build';
13+
const NINJA_FILE: string = 'build.ninja';
1614

1715
const ACTION: string = 'action';
1816
const BUILD: string = 'build';
@@ -131,13 +129,6 @@ async function findPython(): Promise<string> {
131129
throw new Error('Python could not be found');
132130

133131
core.debug('Found Python using which');
134-
135-
// if (hasbin.sync(PYTHON)) {
136-
// core.debug('Found Python in the path');
137-
// python = PYTHON;
138-
// } else {
139-
// throw new Error('Python could not be found');
140-
// }
141132
}
142133

143134
pythonCache = python;
@@ -147,11 +138,6 @@ async function findPython(): Promise<string> {
147138
async function findNinja(): Promise<string> {
148139
core.debug('Checking for Ninja...');
149140

150-
// if (hasbin.sync(NINJA)) {
151-
// core.debug('Found Ninja in the path')
152-
// return;
153-
// }
154-
155141
try {
156142
const ninja: string = await io.which(NINJA);
157143
if (ninja.length < 1)
@@ -175,12 +161,6 @@ async function findNinja(): Promise<string> {
175161
async function findMeson(): Promise<string> {
176162
core.debug('Checking for Meson...');
177163

178-
// await checkNinja();
179-
180-
// if (hasbin.sync(MESON)) {
181-
// core.debug('Found Meson in the path');
182-
// return;
183-
// }
184164
try {
185165
const meson: string = await io.which(MESON);
186166
if (meson.length < 1)
@@ -203,11 +183,6 @@ async function findMeson(): Promise<string> {
203183

204184
async function findCoverage(): Promise<string> {
205185
core.debug(`Checking for ${COVERAGE}`);
206-
207-
// if (hasbin.sync(GCOVR)) {
208-
// core.debug('Found gcovr in the path');
209-
// return;
210-
// }
211186

212187
try {
213188
const gcovr: string = await io.which(GCOVR);
@@ -237,8 +212,6 @@ async function findTidy(): Promise<string> {
237212
throw new Error('Clang-tidy must be installed to run it');
238213

239214
return tidy;
240-
// if (!hasbin.sync(CLANG_TIDY))
241-
// throw new Error('Clang-tidy must be installed to run it');
242215
}
243216

244217
export async function run() {

0 commit comments

Comments
 (0)