Skip to content

Commit

Permalink
0.4.0 Windows: fix routing, package with JRE
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTom committed Jul 11, 2017
1 parent 54b65bc commit 323c54e
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .mux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: madek/app
name: madek/exporter

windows:
2:
Expand Down
2 changes: 1 addition & 1 deletion app/prod/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Madek",
"version": "0.3.0",
"version": "0.4.0",
"main": "js/main.js"
}
4 changes: 1 addition & 3 deletions bin/build-win
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ rm -rf ./madek-app-win32-x64
--icon=Madek.icns \
./app/prod madek-app

#cp -rf vendor/jre_darwin/Contents/Home ./madek-app-darwin-x64/madek-app.app/Contents/Resources/jre

#cp target/app-server.jar ./madek-app-darwin-x64/madek-app.app/Contents/Resources/
cp -Lrf vendor/jre_win ./madek-app-win32-x64/resources/jre
10 changes: 10 additions & 0 deletions electron_front/src/all/madek/app/front/debug.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@
[clojure.walk]
))

(defn fix-path [path]
(clojure.string/replace path #"^/\w:" ""))

(defn content []
[:div.content
[:div.form
[:div.form-group
[:input {:type :checkbox :on-click #(swap! state/client-db assoc :debug (-> @state/client-db :debug not))
:checked (-> @state/client-db :debug)}]
" Show per page debug info"]]

[:div
[:h3 "PATH "]
[:pre
(with-out-str
(pprint (fix-path "/C:/debug")))]]

[:p "Electron main "
(if (empty? @state/electron-main-db)
"waiting ..."
Expand Down
3 changes: 2 additions & 1 deletion electron_front/src/all/madek/app/front/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
[madek.app.front.routes :as routes]
[madek.app.front.state :as state]
[madek.app.front.utils :refer [str keyword deep-merge]]

[accountant.core :as accountant]
[reagent.core :as reagent :refer [atom]]
[secretary.core :as secretary :include-macros true :refer [defroute]]
))
Expand All @@ -28,7 +30,6 @@
[:li
[:a [connection/compact-component]]]]]])


(defn root-component []
[:div.container-fluid
[request/modal]
Expand Down
11 changes: 9 additions & 2 deletions electron_front/src/all/madek/app/front/routes.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@
(defroute debug-page "/debug" []
(reset! madek.app.front.state/current-page madek.app.front.debug/page))


; under windows the paths somehow come es e.g. "/C:/about" instead
; of "/about"; this might not cover all cases but is also dangerous
; to just remove everything before the colon
(defn fix-path [path]
(clojure.string/replace path #"^/\w:" ""))

(defn init []
(accountant/configure-navigation!
{:nav-handler (fn [path] (secretary/dispatch! path))
:path-exists? (fn [path] (secretary/locate-route path))})
{:nav-handler (fn [path] (-> path fix-path secretary/dispatch!))
:path-exists? (fn [path] (-> path fix-path secretary/locate-route))})
(secretary/dispatch! "/connection")
(accountant/dispatch-current!))
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "madek",
"version": "0.0.0",
"name": "madek-exporter",
"version": "0.4.0",
"description": "",
"devDependencies": {
"grunt": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject madek "0.3.0"
(defproject madek "0.4.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "GPL"
Expand Down
2 changes: 1 addition & 1 deletion vendor

0 comments on commit 323c54e

Please sign in to comment.