Skip to content

Commit

Permalink
move to pods
Browse files Browse the repository at this point in the history
  • Loading branch information
burn2delete committed Apr 28, 2020
1 parent aec2b15 commit b450e67
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 36 deletions.
2 changes: 2 additions & 0 deletions boot.properties
@@ -0,0 +1,2 @@
BOOT_VERSION=2.8.2
BOOT_CLOJURE_VERSION=1.10.0
5 changes: 2 additions & 3 deletions build.boot
@@ -1,8 +1,7 @@
(set-env!
:dependencies '[[org.clojure/clojure "1.8.0"]
[boot/core "2.7.2"]
:dependencies '[[boot/core "2.8.2"]
[commons-io "2.6"]
[degree9/boot-semver "1.7.0" :scope "test"]]
[degree9/boot-semver "1.8.0" :scope "test"]]
:resource-paths #{"src"})

(require '[degree9.boot-semver :refer :all])
Expand Down
38 changes: 6 additions & 32 deletions src/degree9/boot_io.clj
@@ -1,35 +1,9 @@
(ns degree9.boot-io
(:require [boot.core :as boot]
[boot.util :as util]
[clojure.java.io :as io])
(:import (org.apache.commons.io FileUtils)
(java.io FileNotFoundException)))

;; Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn- exists? [item]
(.exists item))

(defn- file? [file]
(.isFile file))

(defn- directory? [dir]
(.isDirectory dir))

(defn- copy-file [source target]
(FileUtils/copyFile source target))

(defn- copy-dir [source target]
(FileUtils/copyDirectory source target))

(defn- to-dir [source target]
(FileUtils/copyToDirectory source target))

(defn- mk-dir [dir]
(FileUtils/forceMkdir dir))

(defn- mk-parent [file]
(FileUtils/forceMkdirParent file))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[clojure.java.io :as io]
[degree9.boot-io.filesystem :as fs])
(:import (java.io FileNotFoundException)))

;; IO Tasks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(boot/deftask add-directory
Expand All @@ -47,7 +21,7 @@
(util/fail "Please provide both `source` and `destination` options. \n"))
(util/info "Adding directory to fileset... \n")
(util/info "• %s -> %s \n" src dst)
(try (copy-dir source target)
(try (fs/copy-dir source target)
(catch FileNotFoundException npe (when-not optional npe)))
(-> fileset (boot/add-resource tmp) boot/commit!))))

Expand All @@ -67,7 +41,7 @@
(util/fail "Please provide both `source` and `destination` options. \n"))
(util/info "Adding file to fileset... \n")
(util/info "• %s -> %s \n" src dst)
(try (copy-file source target)
(try (fs/copy-file source target)
(catch FileNotFoundException npe (when-not optional npe)))
(-> fileset (boot/add-resource tmp) boot/commit!))))

Expand All @@ -86,7 +60,7 @@
(util/fail "Please provide both `source` and `destination` options. \n"))
(util/info "Adding items to fileset... \n")
(util/info "• %s -> %s \n" src dst)
(try (to-dir source target)
(try (fs/to-dir source target)
(catch FileNotFoundException npe (when-not optional npe)))
(-> fileset (boot/add-resource tmp) boot/commit!))))

Expand Down
29 changes: 29 additions & 0 deletions src/degree9/boot_io/filesystem.clj
@@ -0,0 +1,29 @@
(ns degree9.boot-io.filesystem
(:require [clojure.java.io :as io])
(:import (org.apache.commons.io FileUtils)))

;; Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn exists? [item]
(.exists item))

(defn file? [file]
(.isFile file))

(defn directory? [dir]
(.isDirectory dir))

(defn copy-file [source target]
(FileUtils/copyFile source target))

(defn copy-dir [source target]
(FileUtils/copyDirectory source target))

(defn to-dir [source target]
(FileUtils/copyToDirectory source target))

(defn mk-dir [dir]
(FileUtils/forceMkdir dir))

(defn mk-parent [file]
(FileUtils/forceMkdirParent file))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 changes: 1 addition & 1 deletion version.properties
@@ -1,2 +1,2 @@
#Sun Dec 10 23:12:00 MST 2017
VERSION=1.3.0
VERSION=1.4.0

0 comments on commit b450e67

Please sign in to comment.