• Stars
    star
    14
  • Rank 1,379,753 (Top 29 %)
  • Language
    Groovy
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Simple DSL to create Directory Tree with Text Files

DirecTree

A Simple DSL for :

  • Creating directory trees with text files (with contents).
  • Keeping multiple source directories in sync with a target directory.

Build

directree is available in jcenter maven repository.

@Grab('io.github.kdabir.directree:directree:0.3.2')
import static directree.DirTree.create

create("my-dir") {
    dir ("todo") {
        file "first.txt", "check out this new library"
    }

    file ("README.md") { """
        Directree
        ${'='*80}

        There are multiple ways in which content can be written to a file.
        after all, its all a valid groovy code.
        """.stripIndent()
    }
}

Verifying it:

$ tree my-dir

my-dir
|-- README.md
`-- todo
    `-- first.txt

1 directory, 2 files

$ cat my-dir/README.md

Directree
================================================================================

There are multiple ways in which content can be written to a file.
after all, its all a valid groovy code.

$ cat my-dir/todo/first.txt

check out this new library

More realistic example

You can create a project structure:

create("my-project") {
    dir "src" , {
        file "hello.groovy", "println 'hello world'"
    }
    dir "test", {
        file ".gitkeep"
    }
    file "build.gradle" , ""
    file ".gitignore", "*.class"
}

create(".") will create the files and directories in current directory.

More Repositories

1

awesome-groovy

A curated list of awesome groovy libraries, frameworks and resources
Groovy
704
star
2

has

βœ… checks presence of various command line tools and their versions on the path
Shell
595
star
3

gstorm

A simple ORM for databases and CSV files. Intended to be used in groovy scripts and small projects
Groovy
81
star
4

glide

Create awesome apps on Google App Engine in a snap
Groovy
53
star
5

active-directory-lookup

Simplest Java API (and CLI) for authenticating and searching in Active Directory
Java
18
star
6

lazybone-templates

My Lazybone Templates
Groovy
14
star
7

nixstall

Generic package installer for the packages that are not listed in your favourite package manager
Shell
9
star
8

mac-setup

Setup MacOS for developers
Shell
8
star
9

redash-mac

Running Redash locally on Mac using Docker Compose
Makefile
7
star
10

json-sql-console

Query json like a pro
JavaScript
7
star
11

tomcat-instance-manager

Manage multiple Tomcat instances on Windows using a single Tomcat installation
Batchfile
6
star
12

feku

Generate Intelligent Random Data
JavaScript
6
star
13

finder-buttons

MacOS Finder buttons for quick actions
AppleScript
6
star
14

gmail-saved-searches

chrome plugin to save your gmail search strings and quickly access when required
JavaScript
4
star
15

travis-groovy

execute groovy scripts on travis-ci
Groovy
3
star
16

stay-awake

Keeps machine awake and unlocked
Java
2
star
17

gradle-helpers

Kitchensink utility methods for any gradle build script
Groovy
2
star
18

directree.rb

A simple DSL to create Directory Tree and Files with content, powered by ruby
Ruby
2
star
19

mksrc

Gradle plugin to create source directories and autogenerate settings.gradle file
Groovy
2
star
20

gatling-starter

A skeleton project for performance testing of your web application
Scala
2
star
21

exfost

Expressions For Statements
TypeScript
1
star
22

roft

Gradle plugin to Rerun Only Failed Tests
Groovy
1
star
23

directree.js

Create directory trees with files and content
JavaScript
1
star
24

to-kv

Converts Array of Objects to a simple Key-Value structure.
JavaScript
1
star