/.nrepl-port
.hgignore
.hg/
+/.config/
--- /dev/null
+# tl;dr AGPLv3+
+# copyright info at bottom
+
+all:test
+
+test:
+ @./test.bash
+
+test-staged:
+ @./test-staged.bash
+
+# flibbertigibbet is a lein new flibbertigibbet project-name
+# Copyright (C) 2016 daniel watson
+
+# This file is part of flibbertigibbet.
+
+# flibbertigibbet is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# flibbertigibbet is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Affero Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with flibbertigibbet. If not, see
+# <http://www.gnu.org/licenses/>.
--- /dev/null
+#! /usr/bin/env bash
+# tl;dr AGPLv3+
+# copyright info at bottom
+
+set -o nounset
+set -o errexit
+
+GILT_HOOKUP_DEBUG="${GILT_HOOKUP_DEBUG:-}"
+
+if (( GILT_HOOKUP_DEBUG )); then
+ set -x
+ echo "in $0"
+ pwd
+fi
+
+# create a temp directory to hold just the staged content
+# mktemp is used twice here, the first works on gnu,
+# the second works on mac
+stage_dir=`mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir'`
+
+# remove the temp staging directory when sigterm, sigint (ctrl-c),
+# and when the script exits normally
+# the exit status of the script will not be affected by this trap
+# when it traps the SIGEXIT signal
+# if we're debugging, then leave the testing directory around
+# for inspection
+if (( ! GILT_HOOKUP_DEBUG )); then
+ trap 'rm -rf "$stage_dir"' SIGTERM SIGINT EXIT
+fi
+
+# checkout all staged files into temporary staging directory
+git checkout-index --prefix="${stage_dir}/" --all \
+ && sync
+
+if (( GILT_HOOKUP_DEBUG )); then
+ tree "$stage_dir"
+fi
+
+# run make in temporary staging directory
+make --directory="$stage_dir"
+
+# flibbertigibbet is a lein new flibbertigibbet project-name
+# Copyright (C) 2016 daniel watson
+
+# This file is part of flibbertigibbet.
+
+# flibbertigibbet is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# flibbertigibbet is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Affero Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with flibbertigibbet. If not, see
+# <http://www.gnu.org/licenses/>.
--- /dev/null
+#! /usr/bin/env bash
+# tl;dr AGPLv3+
+# copyright info at bottom
+
+set -o nounset
+set -o errexit
+
+GILT_HOOKUP_DEBUG="${GILT_HOOKUP_DEBUG:-}"
+
+if (( GILT_HOOKUP_DEBUG )); then
+ set -x
+ echo "in $0"
+fi
+
+# flibbertigibbet is a lein new flibbertigibbet project-name
+# Copyright (C) 2016 daniel watson
+
+# This file is part of flibbertigibbet.
+
+# flibbertigibbet is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# flibbertigibbet is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Affero Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with flibbertigibbet. If not, see
+# <http://www.gnu.org/licenses/>.
--- /dev/null
+(ns leiningen.new.flibbertigibbet-test
+ (:require [clojure.test :refer :all]
+ [leiningen.new.flibbertigibbet :refer :all]))
+
+(defn safe-delete [file-path]
+ (if (.exists (clojure.java.io/file file-path))
+ (try
+ (clojure.java.io/delete-file file-path)
+ (catch Exception e (str "exception: " (.getMessage e))))
+ false))
+
+(defn delete-directory [directory]
+ (let [contents (file-seq (clojure.java.io/file directory))
+ delete-files (filter #(.isFile %) contents)]
+ (doseq [file delete-files]
+ (safe-delete (.getPath file)))
+ (safe-delete directory)))
+
+(deftest a-test
+ (testing "flibbertigibbet should advertise itself, so i know it works"
+ (is (= "Generating fresh 'lein new' flibbertigibbet project: projecta\n"
+ (with-out-str (flibbertigibbet "projecta"))))
+ (delete-directory "./projecta")))