From 6cc0700aa5b90500b620ca8dd5b2976892aee0a7 Mon Sep 17 00:00:00 2001 From: www-data Date: Thu, 8 Aug 2019 10:07:30 +0200 Subject: [PATCH] Add a deploy script. --- decrypt_message.ps1 | 0 deploy.ps1 | 14 ++++++++++++++ encrypt_message.ps1 | 0 src/main.rs | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 decrypt_message.ps1 create mode 100755 deploy.ps1 mode change 100644 => 100755 encrypt_message.ps1 diff --git a/decrypt_message.ps1 b/decrypt_message.ps1 old mode 100644 new mode 100755 diff --git a/deploy.ps1 b/deploy.ps1 new file mode 100755 index 0000000..5edd2a4 --- /dev/null +++ b/deploy.ps1 @@ -0,0 +1,14 @@ +git pull +cargo build --release + +$destination=$args[0] + +if (!(Test-Path -Path $destination)) { + New-Item -ItemType directory -Path $destination +} + +Copy-Item target/release/rup -Destination $destination +Copy-Item key.secret -Destination $destination +Copy-Item conf.ron -Destination $destination +Copy-Item static -Destination $destination -Recurse -Force + diff --git a/encrypt_message.ps1 b/encrypt_message.ps1 old mode 100644 new mode 100755 diff --git a/src/main.rs b/src/main.rs index 6ecbb0a..6c9ab27 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ fn read_key() -> String { .expect(&format!("Failed to read key file: {}", consts::FILE_KEY)); String::from( - percent_encoding::percent_decode(key.as_bytes()) + percent_encoding::percent_decode(key.replace('\n', "").as_bytes()) .decode_utf8() .expect(&format!("Failed to decode key file: {}", consts::FILE_KEY)) ) -- 2.45.2