Skip to content

Commit

Permalink
Fix race condition in get_file
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Sep 6, 2019
1 parent 202f1bb commit 2f94ea1
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 114 deletions.
16 changes: 12 additions & 4 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const exec_1 = require("@actions/exec/lib/exec");
var https = require('https');
const https = require('https');
const fs = require('fs');
function get_file(filename) {
return __awaiter(this, void 0, void 0, function* () {
let github_path = 'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/';
let github_path = 'https://raw.githubusercontent.com/shivammathur/setup-php/master/src/';
const file = fs.createWriteStream(filename);
const request = https.get(github_path + filename, function (response) {
response.pipe(file);
file.on('open', function (fd) {
https.get(github_path + filename, function (response) {
response
.on('data', function (chunk) {
file.write(chunk);
})
.on('end', function () {
file.end();
});
});
});
});
}
Expand Down
58 changes: 0 additions & 58 deletions lib/src/install.js

This file was deleted.

4 changes: 0 additions & 4 deletions lib/test.js

This file was deleted.

24 changes: 14 additions & 10 deletions node_modules/@types/jest-diff/package.json

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

22 changes: 13 additions & 9 deletions node_modules/@types/jest/package.json

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

22 changes: 12 additions & 10 deletions node_modules/fs/package.json

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

22 changes: 12 additions & 10 deletions node_modules/https/package.json

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

Loading

0 comments on commit 2f94ea1

Please sign in to comment.