Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM node:current-alpine

WORKDIR /kill-sticky
WORKDIR /build/kill-sticky

RUN set -x \
&& npm install uglify-js get-stdin mustache -g
&& mkdir /build/node_modules \
&& npm install -g uglify-js mustache \
&& npm install get-stdin

ENTRYPOINT uglifyjs <src/kill-sticky.js \
| NODE_PATH=$(npm root --quiet -g) node src/bookmarkletify.js \
| node src/bookmarkletify.mjs \
| mustache - src/README.mustache.md > README.md
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

all:
docker build . -t kill-sticky
docker run --rm -t -v $(shell pwd):/kill-sticky kill-sticky
docker run --rm -t -v $(shell pwd):/build/kill-sticky kill-sticky
docker rmi kill-sticky
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ We're creating a bookmarklet, so our code needs to be minified and URL encoded.
Run the following the project root directory:

```console
$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/kill-sticky kill-sticky
$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/build/kill-sticky kill-sticky
```

_This will update the project README.md with the build version._
2 changes: 1 addition & 1 deletion src/README.mustache.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ We're creating a bookmarklet, so our code needs to be minified and URL encoded.
Run the following the project root directory:

```console
$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/kill-sticky kill-sticky
$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/build/kill-sticky kill-sticky
```

_This will update the project README.md with the build version._
2 changes: 1 addition & 1 deletion src/bookmarkletify.js → src/bookmarkletify.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const getStdin = require('get-stdin');
import getStdin from 'get-stdin';

getStdin().then(str => {
console.log(`{"bookmarklet": "javascript:${encodeURIComponent(str)}"}`);
Expand Down