Skip to content

Commit

Permalink
pacman-tool-repo: update v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Jan 28, 2024
1 parent a26b60a commit 366e22d
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 2,310 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
- 'index.js'
- 'package.json'
- 'package-lock.json'
- 'pacman-tool-repo/setup.sh'
- 'pacman-tool-repo/repo-add'
- 'pacman-tool-repo/util/**'
- 'node_modules/**'
- '.github/workflows/test.yml'

Expand All @@ -18,15 +15,8 @@ jobs:
runs-on: ubuntu-latest
name: Check commands
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
- run: |
./test.sh
#debug2:
# runs-on: ubuntu-latest
# name: Check commands
# steps:
# - uses: actions/checkout@v3
# - uses: termux-pacman/pacman-tool-repo@v1
# - run: |
# ./test.sh
sudo apt search pacman
repo-add --version
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ubuntu-latest
name: Example
steps:
- uses: actions/checkout@v3
- uses: termux-pacman/pacman-tool-repo@v1.1
- uses: actions/checkout@v4
- uses: termux-pacman/pacman-tool-repo@v2
- run: |
repo-add --help
repo-remove --help
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ branding:
icon: 'database'
color: 'blue'
runs:
using: 'node16'
using: 'node20'
main: 'index.js'
36 changes: 16 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
// Running a script that sets everything up

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

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 start() {
await exec.exec("sudo su -c \"echo 'deb http://archive.ubuntu.com/ubuntu/ lunar universe' > /etc/apt/sources.list.d/lunar.list\"");
await exec.exec("sudo su -c \"echo 'deb-src http://archive.ubuntu.com/ubuntu/ lunar universe' >> /etc/apt/sources.list.d/lunar.list\"");

while (true) {
try {
await exec.exec("sudo apt update -y");
await exec.exec("sudo apt install pacman-package-manager -y");
break;
} catch (error) {
continue;
}
}
}

start();
19 changes: 0 additions & 19 deletions node_modules/.package-lock.json

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

18 changes: 0 additions & 18 deletions node_modules/follow-redirects/LICENSE

This file was deleted.

155 changes: 0 additions & 155 deletions node_modules/follow-redirects/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/follow-redirects/debug.js

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/follow-redirects/http.js

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/follow-redirects/https.js

This file was deleted.

Loading

0 comments on commit 366e22d

Please sign in to comment.