Skip to content

Commit

Permalink
Inject version during build into the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Feb 9, 2020
1 parent f039f35 commit 2ee2e68
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ build:

.PHONY: build-frontend
build-frontend:
cd frontend && yarn build
export REACT_APP_VERSION="${VERSION}" && cd frontend && yarn build

.PHONY: run
run: build
./${BIN}

.PHONY: run-frontend
run-frontend:
cd frontend && yarn start
export REACT_APP_VERSION="${VERSION}" && cd frontend && yarn start

.PHONY: test
test:
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "my",
"name": "listmonk",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
<title>listmonk</title>
<script>VERSION = "%REACT_APP_VERSION%";</script>
</head>
<body>
<noscript>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ class Base extends React.Component {
>
listmonk
</a>{" "}
&copy; 2019 {year !== 2019 ? " - " + year : ""} &mdash;{" "}
&copy; 2019 {year !== 2019 ? " - " + year : ""}.
Version { process.env.REACT_APP_VERSION } &mdash;{" "}
<a
href="https://listmonk.app/docs"
target="_blank"
Expand Down

0 comments on commit 2ee2e68

Please sign in to comment.