Skip to content

Commit

Permalink
pacman-tool-repo-v1.1: fewer modules and better security
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Apr 2, 2023
1 parent 00ebccd commit e9b8679
Show file tree
Hide file tree
Showing 583 changed files with 937 additions and 107,827 deletions.
35 changes: 15 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@

const exec = require('@actions/exec');
const fs = require('fs');
const request = require('request');
var https = require('follow-redirects').https;
const process = require('process');
const os = require('os');
const path = require('path');

function download() {
return new Promise(function (resolve) {
request("https://github.com/termux-pacman/pacman-tool-repo/raw/main/pacman-tool-repo.tar.xz", function () {
resolve(null);
}).pipe(fs.createWriteStream("pacman-tool-repo.tar.xz"));
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "ptr"));
process.chdir(tmpDir);
const file = fs.createWriteStream("pacman-tool-repo.tar.xz");
const request = https.get("https://github.com/termux-pacman/pacman-tool-repo/raw/main/pacman-tool-repo.tar.xz", function(response) {
response.pipe(file);
file.on("finish", async() => {
file.close();
await exec.exec("tar xJf pacman-tool-repo.tar.xz");
fs.unlinkSync("pacman-tool-repo.tar.xz");
process.chdir("pacman-tool-repo/");
await exec.exec("sudo ./setup.sh");
process.chdir(__dirname);
fs.rmSync(tmpDir, {recursive:true, force:true});
});
}

async function main() {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "ptr"));
await download();
await exec.exec("tar xJf pacman-tool-repo.tar.xz");
fs.unlinkSync("pacman-tool-repo.tar.xz");
process.chdir("pacman-tool-repo/");
await exec.exec("sudo ./setup.sh");
process.chdir(__dirname);
fs.rmSync(tmpDir, {recursive:true, force:true});
}

main();
});
1 change: 0 additions & 1 deletion node_modules/.bin/sshpk-conv

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/sshpk-sign

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/sshpk-verify

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/uuid

This file was deleted.

Loading

0 comments on commit e9b8679

Please sign in to comment.