Skip to content

Commit 2474bc1

Browse files
committed
Adding Makefile target for swapping the URL
1 parent 170eaa1 commit 2474bc1

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,16 @@ package-darwin: require-version require-appdmg require-svgexport darwin
318318
echo "-> Skipped: Can not generate a package on a non-OSX host."; \
319319
fi;
320320

321+
manoto:
322+
@echo "Replacing URL_TOKEN with manoto"
323+
perl -pi -e "s/URL_TOKEN/https:\/\/www.facebook.com\/manototv/" src/github.com/getlantern/flashlight/ui/ui.go
324+
325+
unmanoto:
326+
@echo "Replacing manoto url with URL_TOKEN"
327+
perl -pi -e "s/https:\/\/www.facebook.com\/manototv/URL_TOKEN/" src/github.com/getlantern/flashlight/ui/ui.go
328+
329+
manoto-binaries: manoto binaries unmanoto
330+
321331
binaries: docker genassets linux windows darwin
322332

323333
packages: require-version require-secrets clean genconfig binaries package-windows package-linux package-darwin

src/github.com/getlantern/flashlight/ui/ui.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717

1818
const (
1919
LocalUIDir = "../../../lantern-ui/app"
20+
URL_CONST = "URL_TOKEN"
2021
)
2122

2223
var (
@@ -28,7 +29,8 @@ var (
2829
server *http.Server
2930
uiaddr string
3031

31-
r = http.NewServeMux()
32+
externalUrl = URL_CONST
33+
r = http.NewServeMux()
3234
)
3335

3436
func init() {
@@ -96,7 +98,9 @@ func Show() {
9698
return
9799
}
98100
open.Run(uiaddr)
99-
time.Sleep(4 * time.Second)
100-
open.Run("https://www.facebook.com/manototv")
101+
if externalUrl != URL_CONST {
102+
time.Sleep(4 * time.Second)
103+
open.Run(externalUrl)
104+
}
101105
}()
102106
}

0 commit comments

Comments
 (0)