Compare commits

...

4 commits
v1.0.4 ... main

Author SHA1 Message Date
timoxa0 c7f825858c Update installers/linux.sh 2025-01-22 08:32:28 +00:00
timoxa0 01cab85f6b deploy: try to restart adb server on dev timeout 2024-10-22 15:59:24 +05:00
timoxa0 43ef704a32 Fix message 2024-08-13 08:44:22 +00:00
timoxa0 79a4768ae7 Fix typo 2024-08-08 07:26:30 +00:00
4 changed files with 41 additions and 6 deletions

View file

@ -8,5 +8,5 @@
### Linux (binary) ### Linux (binary)
```curl -Ls s.tx0.su/ltl | bash``` ```curl -Ls s.tx0.su/ltl | bash```
### Linux/macOS (biuld from source) ### Linux/macOS (build from source)
```curl -Ls s.tx0.su/lts | bash``` ```curl -Ls s.tx0.su/lts | bash```

View file

@ -230,7 +230,24 @@ var deployCmd = &cobra.Command{
for i := 0; i <= 120; i++ { for i := 0; i <= 120; i++ {
if i == 120 { if i == 120 {
ofoxSpinner.Stop() ofoxSpinner.Stop()
logger.Error("Recovery device timeout") logger.Warn("Recovery device timeout")
logger.Info("Trying to restart adb server")
err := adbc.KillServer();
if err != nil {
logger.Error("Failed to kill server")
os.Exit(173);
}
err = adbc.StartServer();
if err != nil {
logger.Error("Failed to start server")
os.Exit(173);
}
adbd = adbc.Device(adb.DeviceWithSerial(serail));
if s, _ := adbd.State(); s == adb.StateRecovery {
logger.Info("Device found")
break
}
logger.Error("Device not found")
os.Exit(173) os.Exit(173)
} }
if s, _ := adbd.State(); s == adb.StateRecovery { if s, _ := adbd.State(); s == adb.StateRecovery {
@ -276,7 +293,24 @@ var deployCmd = &cobra.Command{
for i := 0; i <= 120; i++ { for i := 0; i <= 120; i++ {
if i == 120 { if i == 120 {
ofoxSpinner.Stop() ofoxSpinner.Stop()
logger.Error("Recovery device timeout") logger.Warn("Recovery device timeout")
logger.Info("Trying to restart adb server")
err := adbc.KillServer();
if err != nil {
logger.Error("Failed to kill server")
os.Exit(173);
}
err = adbc.StartServer();
if err != nil {
logger.Error("Failed to start server")
os.Exit(173);
}
adbd = adbc.Device(adb.DeviceWithSerial(serail));
if s, _ := adbd.State(); s == adb.StateRecovery {
logger.Info("Device found")
break
}
logger.Error("Device not found")
os.Exit(173) os.Exit(173)
} }
if s, _ := adbd.State(); s == adb.StateRecovery { if s, _ := adbd.State(); s == adb.StateRecovery {
@ -286,6 +320,7 @@ var deployCmd = &cobra.Command{
time.Sleep(time.Second) time.Sleep(time.Second)
} }
port, err := utils.GetFreePort() port, err := utils.GetFreePort()
if err != nil { if err != nil {
logger.Error("Failled to find free tcp port") logger.Error("Failled to find free tcp port")

View file

@ -23,6 +23,6 @@ pushd ~/.lon-tool-src &> /dev/null
rev=$(git describe --abbrev=4 --dirty --always --tags) rev=$(git describe --abbrev=4 --dirty --always --tags)
go get git.timoxa0.su/timoxa0/lon-tool/cmd go get git.timoxa0.su/timoxa0/lon-tool/cmd
go build -ldflags "-X git.timoxa0.su/timoxa0/lon-tool/cmd.version=$rev" -o "$HOME/.local/bin/lon-tool" main.go && { go build -ldflags "-X git.timoxa0.su/timoxa0/lon-tool/cmd.version=$rev" -o "$HOME/.local/bin/lon-tool" main.go && {
printf "\e[32mDone!\e[0m Installed at %s\n" "$HOME/go/bin/lon-tool" printf "\e[32mDone!\e[0m Installed at %s\n" "$HOME/.local/bin/lon-tool"
} }
popd &> /dev/null popd &> /dev/null

View file

@ -6,7 +6,7 @@ URL="https://git.timoxa0.su/timoxa0/lon-tool/releases/download/latest/lon-tool_l
exit 1 exit 1
} }
[ -d "$HOME/.local/bin" ] && { [ -d "$HOME/.local/bin" ] || {
mkdir --parent "$HOME/.local/bin" mkdir --parent "$HOME/.local/bin"
} }