summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--README.md3
-rwxr-xr-xbin/setup4
-rw-r--r--lib/config/environment.js2
-rw-r--r--lib/models/revision.js8
5 files changed, 10 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index cfb064c5..61ced7a9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,6 @@ dist: trusty
node_js:
- 6
- 7
- - lts/boron
env:
- CXX=g++-4.8
cache: yarn
diff --git a/README.md b/README.md
index f3de14a6..78d3e352 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@ HackMD
[![Join the chat at https://gitter.im/hackmdio/hackmd][gitter-image]][gitter-url]
[![build status][travis-image]][travis-url]
+[![version][github-version-badge]][github-release-page]
HackMD lets you create realtime collaborative markdown notes on all platforms.
@@ -233,5 +234,7 @@ See more at [http://operational-transformation.github.io/](http://operational-tr
[gitter-url]: https://gitter.im/hackmdio/hackmd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[travis-image]: https://travis-ci.org/hackmdio/hackmd.svg?branch=master
[travis-url]: https://travis-ci.org/hackmdio/hackmd
+[github-version-badge]: https://img.shields.io/github/release/hackmdio/hackmd.svg
+[github-release-page]: https://github.com/hackmdio/hackmd/releases
[standardjs-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg
[standardjs-url]: https://github.com/feross/standard
diff --git a/bin/setup b/bin/setup
index 3f143cd3..3edffc49 100755
--- a/bin/setup
+++ b/bin/setup
@@ -5,7 +5,7 @@ set -e
# run command at repo root
CURRENT_PATH=$PWD
if [ -d .git ]; then
- cd $(git rev-parse --show-toplevel)
+ cd "$(git rev-parse --show-toplevel)"
fi
if ! type npm > /dev/null
@@ -43,4 +43,4 @@ Read more info at https://github.com/hackmdio/hackmd#configuration-files
EOF
# change directory back
-cd $CURRENT_PATH
+cd "$CURRENT_PATH"
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 75381ffc..c108a6f9 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -6,7 +6,7 @@ module.exports = {
domain: process.env.HMD_DOMAIN,
urlpath: process.env.HMD_URL_PATH,
port: process.env.HMD_PORT,
- urladdport: process.env.HMD_URL_ADDPORT,
+ urladdport: toBooleanConfig(process.env.HMD_URL_ADDPORT),
usessl: toBooleanConfig(process.env.HMD_USESSL),
protocolusessl: toBooleanConfig(process.env.HMD_PROTOCOL_USESSL),
alloworigin: process.env.HMD_ALLOW_ORIGIN ? process.env.HMD_ALLOW_ORIGIN.split(',') : undefined,
diff --git a/lib/models/revision.js b/lib/models/revision.js
index 6f3a746f..225a95d4 100644
--- a/lib/models/revision.js
+++ b/lib/models/revision.js
@@ -110,7 +110,7 @@ module.exports = function (sequelize, DataTypes) {
where: {
noteId: note.id
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (revisions) {
var data = []
for (var i = 0, l = revisions.length; i < l; i++) {
@@ -131,7 +131,7 @@ module.exports = function (sequelize, DataTypes) {
where: {
noteId: note.id
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (revisions) {
if (revisions.length <= 0) return callback(null, null)
// measure target revision position
@@ -142,7 +142,7 @@ module.exports = function (sequelize, DataTypes) {
$gte: time
}
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (count) {
if (count <= 0) return callback(null, null)
sendDmpWorker({
@@ -231,7 +231,7 @@ module.exports = function (sequelize, DataTypes) {
where: {
noteId: note.id
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (revisions) {
if (revisions.length <= 0) {
// if no revision available