Add a deploy script.
authorwww-data <www-data@ek>
Thu, 8 Aug 2019 08:07:30 +0000 (10:07 +0200)
committerwww-data <www-data@ek>
Thu, 8 Aug 2019 08:07:30 +0000 (10:07 +0200)
decrypt_message.ps1 [changed mode: 0644->0755]
deploy.ps1 [new file with mode: 0755]
encrypt_message.ps1 [changed mode: 0644->0755]
src/main.rs

old mode 100644 (file)
new mode 100755 (executable)
diff --git a/deploy.ps1 b/deploy.ps1
new file mode 100755 (executable)
index 0000000..5edd2a4
--- /dev/null
@@ -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
+
old mode 100644 (file)
new mode 100755 (executable)
index 6ecbb0a..6c9ab27 100644 (file)
@@ -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))
     )