Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Made automated convert to zip, fixed workflow?
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanuk12 committed Jul 11, 2023
1 parent 8099715 commit 514a1cc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
if: github.event_name == 'release'
strategy:
fail-fast: false
matrix:
Expand All @@ -28,3 +29,5 @@ jobs:
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
POST_BUILD: "post_build.sh"
EXTRA_FILES: "RoPro-PATCHED.zip"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
Cargo.lock
.vscode
.vscode
RoPro-PATCHED.zip
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ reqwest = { version = "0.11.18", features = ["blocking"] }
terminal-menu = "2.0.5"
crx-dl = { git = "https://github.com/Stefanuk12/crx-dl.git" }
zip-extract = "0.1.2"
zip = "0.6"
zip-extensions = "0.6.1"
1 change: 1 addition & 0 deletions post_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cargo run --release 1
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Dependencies
use terminal_menu::{run, menu, label, scroll, string, submenu, back_button, button, mut_menu, list};
use zip_extensions::zip_create_from_directory;
use std::{path::PathBuf, fs::{self, File}, io::{Cursor, Write}};
use platform_dirs::AppDirs;
use crx_dl::{ChromeCRXQuery, crx_to_zip};
Expand Down Expand Up @@ -114,6 +115,15 @@ fn main() {
// Download and patch
download_patch(selected_proxy.to_string());

// Zip up
let source_dir = PathBuf::from("RoPro");
zip_create_from_directory(&PathBuf::from("RoPro-PATCHED.zip"), &source_dir)
.expect("unable to create zip");

// Delete directory
fs::remove_dir_all(source_dir)
.expect("unable to remove RoPro folder");

// Done
return
}
Expand Down

1 comment on commit 514a1cc

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 514a1cc Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

Module not found "file:///src/main.ts".

Please sign in to comment.