Update rmapi to v0.0.23

This commit is contained in:
Robert Carosi
2022-12-22 12:27:44 +01:00
parent e2621a1be5
commit ba952c370f
10 changed files with 28 additions and 10 deletions

View File

@@ -52,7 +52,7 @@ from https://docs.docker.com/get-docker/. Then run the following command to star
have not tested it on Windows yet):
```
touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && docker run -it --env TZ=Europe/Amsterdam -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.3.0
touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && docker run -it --env TZ=Europe/Amsterdam -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.4.0
```
The first time you run the application, you will be asked to authorize Pocket and Remarkable Cloud. Once you have done

View File

@@ -7,7 +7,7 @@ plugins {
}
group = "nl.carosi"
version = "0.3.0"
version = "0.4.0"
java {
toolchain {

View File

@@ -2,7 +2,7 @@ version: '3'
services:
remarkable-pocket:
image: ghcr.io/nov1n/remarkable-pocket:0.3.0
image: ghcr.io/nov1n/remarkable-pocket:0.4.0
restart: always
environment:
- TZ=Europe/Amsterdam

View File

@@ -8,7 +8,7 @@
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>while ! /usr/local/bin/docker version > /dev/null 2>&amp;1; do sleep 5; done &amp;&amp; /usr/local/bin/docker run --env TZ=Europe/Amsterdam -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.3.0 1>>$HOME/.remarkable-pocket.log 2>&amp;1</string>
<string>while ! /usr/local/bin/docker version > /dev/null 2>&amp;1; do sleep 5; done &amp;&amp; /usr/local/bin/docker run --env TZ=Europe/Amsterdam -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.4.0 1>>$HOME/.remarkable-pocket.log 2>&amp;1</string>
</array>
<key>RunAtLoad</key>
<true/>

View File

@@ -78,11 +78,11 @@ public class RemarkableApi {
new Thread(
() -> {
Scanner sc = new Scanner(src);
sc.useDelimiter(Pattern.compile("\\n|: "));
sc.useDelimiter(Pattern.compile("\\n|\\): "));
while (sc.hasNext()) {
String token = sc.next();
if (token.equals("Refreshing tree...")) {
consumer.accept("Refreshing cache... This may take a while.");
if (token.startsWith("Enter one-time code")) {
consumer.accept(token + "):");
} else {
consumer.accept(token);
}
@@ -101,11 +101,10 @@ public class RemarkableApi {
public void login() {
try {
Process proc =
new ProcessBuilder(RMAPI_EXECUTABLE, "version").redirectInput(INHERIT).start();
new ProcessBuilder(RMAPI_EXECUTABLE, "account").redirectInput(INHERIT).start();
logStream(proc.getInputStream(), LOG::info);
logStream(proc.getErrorStream(), LOG::error);
int exitCode = proc.waitFor();
LOG.info("");
if (exitCode != 0) {
throw new RuntimeException("Could not authenticate to Remarkable API");
}

View File

@@ -19,7 +19,7 @@ import picocli.CommandLine.Option;
sortOptions = false,
usageHelpAutoWidth = true,
// TODO: Read from gradle.properties
version = "0.3.0",
version = "0.4.0",
mixinStandardHelpOptions = true)
class SyncCommand implements Callable<Integer> {
@Option(

Binary file not shown.

19
update_rmapi_binaries.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Usage: ./update_rmapi_binaries.sh <repo> <version>
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
cd "${1}" || exit
git fetch
git checkout "${2}"
move() {
mv rmapi "${SCRIPT_DIR}"/src/main/jib/usr/local/bin/rmapi_"${1}"
}
GOOS=linux GOARCH=arm64 go build && move "aarch64"
GOOS=linux GOARCH=arm GOARM=5 go build && move "arm"
GOOS=linux GOARCH=amd64 go build && move "amd64"
cd "${SCRIPT_DIR}" || exit