From 517445f2aa943dd94d57dd636b00382b84938739 Mon Sep 17 00:00:00 2001 From: Olaf Leidinger Date: Mon, 20 Nov 2017 23:32:35 +0100 Subject: [PATCH] Add beautifier script and mention it in readme --- README.md | 6 ++++++ beautify-code.sh | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 beautify-code.sh diff --git a/README.md b/README.md index e7e28b4..5a184ac 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,9 @@ A handy zip file can be created using: Thanks to Thomas Liebetraut for the new build system. Get the latest version from: https://github.com/tommie-lie/gnome-shell-extensions-template + +** Contribution ** + +Patches are welcome. But please make sure the code you contribute is formated properly. +Please run `beautify-code.sh` before sending pull requests. Therefore, you'll need to install the +python tool `js-beautify`, e.g. via `pip install jsbeautifier`. diff --git a/beautify-code.sh b/beautify-code.sh new file mode 100644 index 0000000..6fc005c --- /dev/null +++ b/beautify-code.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +SRC_DIR=$(dirname $0) +echo $SRC_DIR + +for fn in "${SRC_DIR}"/src/*.js ; do + js-beautify -t -n -r -j $fn +done