Skip to content

Commit

Permalink
Update tsc incompatible errors
Browse files Browse the repository at this point in the history
  • Loading branch information
qianz2 committed Aug 21, 2023
1 parent 302b3a8 commit 7ab4f6c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
7 changes: 6 additions & 1 deletion node/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,12 @@ function _tryGetExecutablePath(filePath: string, extensions: string[]): string {
// R W X R W X R W X
// 256 128 64 32 16 8 4 2 1
function isUnixExecutable(stats: fs.Stats) {
return (stats.mode & 1) > 0 || ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && stats.uid === process.getuid());
const uid = process.getuid?.(); // Use optional chaining here
const gid = process.getgid?.();

return (stats.mode & 1) > 0 ||
((stats.mode & 8) > 0 && gid !== undefined && stats.gid === gid) ||
((stats.mode & 64) > 0 && uid !== undefined && stats.uid === uid);
}

export function _legacyFindFiles_convertPatternToRegExp(pattern: string): RegExp {
Expand Down
12 changes: 6 additions & 6 deletions node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-task-lib",
"version": "4.4.0",
"version": "5.4.0",
"description": "Azure Pipelines Task SDK",
"main": "./task.js",
"typings": "./task.d.ts",
Expand Down Expand Up @@ -42,7 +42,7 @@
"@types/node": "^20.3.1",
"@types/q": "^1.5.4",
"@types/semver": "^7.3.4",
"@types/shelljs": "^0.8.8",
"@types/shelljs": "^0.8.12",
"mocha": "^9.2.2",
"typescript": "^5.1.6"
}
Expand Down
3 changes: 2 additions & 1 deletion node/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,8 @@ export function mkdirP(p: string): void {
let testDir: string = p;
while (true) {
// validate the loop is not out of control
if (stack.length >= (process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || 1000)) {
const failsafeLimit = parseInt(process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || '1000', 10);
if (stack.length >= failsafeLimit) {
// let the framework throw
debug('loop is out of control');
fs.mkdirSync(p);
Expand Down
2 changes: 1 addition & 1 deletion node/toolrunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ class ExecState extends events.EventEmitter {
private delay = 10000; // 10 seconds
private done: boolean;
private options: IExecOptions;
private timeout: NodeJS.Timer | null = null;
private timeout: NodeJS.Timeout | null = null;
private toolPath: string;

public CheckComplete(): void {
Expand Down

0 comments on commit 7ab4f6c

Please sign in to comment.