add installer script

This commit is contained in:
Kevin Schoon 2019-02-10 15:39:45 -05:00
parent fd5c988f5c
commit cb6867d329
6 changed files with 81 additions and 52 deletions

1
.gitignore vendored
View File

@ -30,5 +30,6 @@ bin/*
www/public/ www/public/
www/data/ www/data/
www/static/install.sh
docs/demo.gif docs/demo.gif

View File

@ -48,12 +48,11 @@ release-darwin: bin/pomo-$(VERSION)-darwin-amd64 bin/pomo-$(VERSION)-darwin-amd6
release: release-linux release-darwin release: release-linux release-darwin
docs: readme docs: www/data/readme.json
cd www && hugo -d ../docs cd www && cp ../install.sh static/ && hugo -d ../docs
readme: www/data/readme.json
www/data/readme.json: www/data README.md www/data/readme.json: www/data README.md
cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > $@ cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > $@
www/data bin: www/data bin:
mkdir -p $@ mkdir -p $@

View File

@ -20,32 +20,18 @@ The Pomodoro Technique is simple and effective:
Binaries are available for Linux and OSX platforms in the [releases section](https://github.com/kevinschoon/pomo/releases) on github. Binaries are available for Linux and OSX platforms in the [releases section](https://github.com/kevinschoon/pomo/releases) on github.
#### Linux ### Installer Script
``` A bash script to download and verify the latest release for Linux and OSX platforms can be run
curl -L -o pomo https://github.com/kevinschoon/pomo/releases/download/0.6.0/pomo-0.6.0-linux-amd64 with the following command:
# Optionally verify file integrity
echo 97be4ccf66c4ae4e3e154f87b9bb0bf2 pomo | md5sum -c -
chmod +x pomo
./pomo -v
# Copy pomo to somewhere on your $PATH
```
#### OSX
```
curl -L -o pomo https://github.com/kevinschoon/pomo/releases/download/0.6.0/pomo-0.6.0-darwin-amd64
# Optionally verify file integrity
[[ $(md5 -r pomo) != "55d77a30dfd6f66c95e19dd83c7ec95c pomo" ]] && echo "invalid hash!"
chmod +x pomo
./pomo -v
# Copy pomo to somewhere on your $PATH
```bash
curl -L -s https://kevinschoon.github.io/pomo/install.sh | bash /dev/stdin
``` ```
### Source ### Source
``` ```bash
go get github.com/kevinschoon/pomo go get github.com/kevinschoon/pomo
pomo -v pomo -v
``` ```
@ -54,12 +40,12 @@ chmod +x pomo
Once `pomo` is installed you need to initialize it's database. Once `pomo` is installed you need to initialize it's database.
``` ``` bash
pomo init pomo init
``` ```
Start a 4 pomodoro session at 25 minute intervals: Start a 4 pomodoro session at 25 minute intervals:
``` ```bash
pomo start -t my-project "write some codes" pomo start -t my-project "write some codes"
``` ```
@ -72,7 +58,7 @@ Pomo has a few configuration options which can be read from a JSON file in Pomo'
You can map colors to specific tags in the `colors` field. You can map colors to specific tags in the `colors` field.
Example: Example:
``` ```json
{ {
"colors": { "colors": {
"my-project": "hiyellow", "my-project": "hiyellow",
@ -93,7 +79,7 @@ making it easy to script and embed it's output in various Linux status bars.
You can create a module with the `custom/script` type and You can create a module with the `custom/script` type and
embed Pomo's status output in your Polybar: embed Pomo's status output in your Polybar:
``` ```ini
[module/pomo] [module/pomo]
type = custom/script type = custom/script
interval = 1 interval = 1
@ -104,7 +90,6 @@ exec = pomo status
## Roadmap ## Roadmap
* Generate charts/burn down * Generate charts/burn down
* System tray notification/icon
* ?? * ??
## Credits ## Credits

View File

@ -146,30 +146,17 @@
<p>Binaries are available for Linux and OSX platforms in the <a href="https://github.com/kevinschoon/pomo/releases">releases section</a> on github.</p> <p>Binaries are available for Linux and OSX platforms in the <a href="https://github.com/kevinschoon/pomo/releases">releases section</a> on github.</p>
<h4 id="linux">Linux</h4> <h3 id="installer-script">Installer Script</h3>
<pre><code>curl -L -o pomo https://github.com/kevinschoon/pomo/releases/download/0.6.0/pomo-0.6.0-linux-amd64 <p>A bash script to download and verify the latest release for Linux and OSX platforms can be run
# Optionally verify file integrity with the following command:</p>
echo 97be4ccf66c4ae4e3e154f87b9bb0bf2 pomo | md5sum -c -
chmod +x pomo
./pomo -v
# Copy pomo to somewhere on your $PATH
</code></pre>
<h4 id="osx">OSX</h4>
<pre><code>curl -L -o pomo https://github.com/kevinschoon/pomo/releases/download/0.6.0/pomo-0.6.0-darwin-amd64
# Optionally verify file integrity
[[ $(md5 -r pomo) != &quot;55d77a30dfd6f66c95e19dd83c7ec95c pomo&quot; ]] &amp;&amp; echo &quot;invalid hash!&quot;
chmod +x pomo
./pomo -v
# Copy pomo to somewhere on your $PATH
<pre><code class="language-bash">curl -L -s https://kevinschoon.github.io/pomo/install.sh | bash /dev/stdin
</code></pre> </code></pre>
<h3 id="source">Source</h3> <h3 id="source">Source</h3>
<pre><code> go get github.com/kevinschoon/pomo <pre><code class="language-bash"> go get github.com/kevinschoon/pomo
pomo -v pomo -v
</code></pre> </code></pre>
@ -177,12 +164,12 @@ chmod +x pomo
<p>Once <code>pomo</code> is installed you need to initialize it&rsquo;s database.</p> <p>Once <code>pomo</code> is installed you need to initialize it&rsquo;s database.</p>
<pre><code>pomo init <pre><code class="language-bash">pomo init
</code></pre> </code></pre>
<p>Start a 4 pomodoro session at 25 minute intervals:</p> <p>Start a 4 pomodoro session at 25 minute intervals:</p>
<pre><code>pomo start -t my-project &quot;write some codes&quot; <pre><code class="language-bash">pomo start -t my-project &quot;write some codes&quot;
</code></pre> </code></pre>
<h2 id="configuration">Configuration</h2> <h2 id="configuration">Configuration</h2>
@ -195,7 +182,7 @@ chmod +x pomo
<p>Example:</p> <p>Example:</p>
<pre><code>{ <pre><code class="language-json">{
&quot;colors&quot;: { &quot;colors&quot;: {
&quot;my-project&quot;: &quot;hiyellow&quot;, &quot;my-project&quot;: &quot;hiyellow&quot;,
&quot;another-project&quot;: &quot;green&quot; &quot;another-project&quot;: &quot;green&quot;
@ -215,7 +202,7 @@ making it easy to script and embed it&rsquo;s output in various Linux status bar
<p>You can create a module with the <code>custom/script</code> type and <p>You can create a module with the <code>custom/script</code> type and
embed Pomo&rsquo;s status output in your Polybar:</p> embed Pomo&rsquo;s status output in your Polybar:</p>
<pre><code>[module/pomo] <pre><code class="language-ini">[module/pomo]
type = custom/script type = custom/script
interval = 1 interval = 1
exec = pomo status exec = pomo status
@ -225,7 +212,6 @@ exec = pomo status
<ul> <ul>
<li>Generate charts/burn down</li> <li>Generate charts/burn down</li>
<li>System tray notification/icon</li>
<li>??</li> <li>??</li>
</ul> </ul>

29
docs/install.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
POMO_VERSION="0.7.0"
OSX_MD5="4aa452e021d07bbb2c7c3a15839fe5df"
LINUX_MD5="84551ab258902e62d9d8e14368bfdf4b"
OSX_TARBALL="https://github.com/kevinschoon/pomo/releases/download/$POMO_VERSION/pomo-$POMO_VERSION-darwin-amd64"
LINUX_TARBALL="https://github.com/kevinschoon/pomo/releases/download/$POMO_VERSION/pomo-$POMO_VERSION-linux-amd64"
install_pomo() {
echo "Installing Pomo..."
if [[ "$OSTYPE" == darwin* ]] ; then {
curl -L -o pomo "$OSX_TARBALL" && \
[[ $(md5 -r pomo) == "$OSX_MD5" ]] && \
chmod +x pomo && \
./pomo -v
} elif [[ "$OSTYPE" == linux* ]] ; then {
curl -L -o pomo "$LINUX_TARBALL" && \
echo "$LINUX_MD5 pomo" | md5sum -c - && \
chmod +x pomo && \
./pomo -v
} else {
echo "cannot detect OS type"
return 1
}
fi
echo "Pomo $POMO_VERSION installed, copy ./pomo to somewhere on your path."
}
install_pomo

29
install.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
POMO_VERSION="0.7.0"
OSX_MD5="4aa452e021d07bbb2c7c3a15839fe5df"
LINUX_MD5="84551ab258902e62d9d8e14368bfdf4b"
OSX_TARBALL="https://github.com/kevinschoon/pomo/releases/download/$POMO_VERSION/pomo-$POMO_VERSION-darwin-amd64"
LINUX_TARBALL="https://github.com/kevinschoon/pomo/releases/download/$POMO_VERSION/pomo-$POMO_VERSION-linux-amd64"
install_pomo() {
echo "Installing Pomo..."
if [[ "$OSTYPE" == darwin* ]] ; then {
curl -L -o pomo "$OSX_TARBALL" && \
[[ $(md5 -r pomo) == "$OSX_MD5" ]] && \
chmod +x pomo && \
./pomo -v
} elif [[ "$OSTYPE" == linux* ]] ; then {
curl -L -o pomo "$LINUX_TARBALL" && \
echo "$LINUX_MD5 pomo" | md5sum -c - && \
chmod +x pomo && \
./pomo -v
} else {
echo "cannot detect OS type"
return 1
}
fi
echo "Pomo $POMO_VERSION installed, copy ./pomo to somewhere on your path."
}
install_pomo