Signing fixed + manual
This commit is contained in:
parent
ffc5ca7a16
commit
afb553896b
14
README.md
14
README.md
|
@ -13,16 +13,12 @@
|
|||
|
||||
1. Укажите токен бота телеграм
|
||||
```bash
|
||||
# Unix-like
|
||||
$ export TELOXIDE_TOKEN=<Your token here>
|
||||
|
||||
# Windows command line
|
||||
$ set TELOXIDE_TOKEN=<Your token here>
|
||||
|
||||
# Windows PowerShell
|
||||
$ $env:TELOXIDE_TOKEN=<Your token here>
|
||||
$ export TELOXIDE_TOKEN=<Ваш токен>
|
||||
```
|
||||
|
||||
2. Добаьте GPG ключ для подписи (опционально)
|
||||
- ```$ gpg --list-keys --keyid-format=long```
|
||||
- rsa4096/*D8DDA4AE70FAD33E* копируем ID ключа после rsa4096,3072..итд
|
||||
- ```$ export GPGKEY=<ID ключа>```
|
||||
3. Запустите бота
|
||||
```bash
|
||||
./aur_builder_bot
|
||||
|
|
11
src/build.rs
11
src/build.rs
|
@ -30,27 +30,28 @@ pub fn copy(dir: String, local_repo: String) -> Result<(), Box<dyn std::error::E
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn build(default_dir: PathBuf) -> Result<(), Box<dyn std::error::Error>> {
|
||||
pub fn build() -> Result<(), Box<dyn std::error::Error>> {
|
||||
match std::env::var("GPGKEY") {
|
||||
Ok(value) => {
|
||||
Command::new("makepkg")
|
||||
.arg("-s")
|
||||
.arg("--sign")
|
||||
.arg(format!("--key {}/{}",default_dir.as_os_str().to_str().unwrap() , value))
|
||||
.arg(format!("--key={}", value))
|
||||
.arg("--noconfirm")
|
||||
.output()?;
|
||||
}
|
||||
},
|
||||
Err(_) => {
|
||||
Command::new("makepkg")
|
||||
.arg("-s")
|
||||
.arg("--noconfirm")
|
||||
.output()?;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
pub fn delete(dir: String) -> std::io::Result<()> {
|
||||
fs::remove_dir_all(dir)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ async fn answer(bot: Bot, msg: Message, cmd: Commands) -> ResponseResult<()> {
|
|||
bot.send_message(msg.chat.id, clone).await?;
|
||||
|
||||
env::set_current_dir(pkg_dir.clone())?;
|
||||
let build = match build(default_dir.clone()) {
|
||||
let build = match build() {
|
||||
Ok(..) => { format!("Builded") },
|
||||
Err(e) => { format!("Build error: {}", e) }
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue