From 465257e3e6ad57d40a71b8b13ff269c38b227f4c Mon Sep 17 00:00:00 2001 From: mollusk Date: Mon, 19 Jun 2017 03:16:32 -0700 Subject: [PATCH] Initial commit --- LICENSE | 0 README.md | 0 TODO.md | 9 +++++++++ src/jprog.jl | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 TODO.md create mode 100644 src/jprog.jl diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..74d40b8 --- /dev/null +++ b/TODO.md @@ -0,0 +1,9 @@ +GOAL: + +[] create a set of diretories (array): + * proj/src + * prog/lib + * prog/readme.md + +[] Allow args to set path + diff --git a/src/jprog.jl b/src/jprog.jl new file mode 100644 index 0000000..61cec9c --- /dev/null +++ b/src/jprog.jl @@ -0,0 +1,56 @@ +#!/usr/bin/julia + + +function check_dir(directory) + + if ispath(directory) + print("The directory: ", directory, " :already exists\n") + return true + + else + print("The directory: ", directory, " :does not exist\n") + return false + end + + +end + +function create_default_structure(projectDir) + + subDirs = ["src", "lib"] + for dirs in subDirs + + mkpath("$projectDir/$dirs") + touch("$projectDir/README.md") + touch("$projectDir/LICENSE") + + end +end + +function help() + print("This will be help\n") +end + +function main() + + if (length(ARGS) == 2 && ARGS[1] == "init") + + print(length(ARGS), "\n") + + if check_dir(ARGS[2]) == true + print("Dir exists") + + else + create_default_structure(ARGS[2]) + if check_dir(ARGS[2]) == true + print("Directory: ", ARGS[2], " created\n") + else + print("The directory: ", ARGS[2], " could not be created\n") + end + end + else + help() + end +end + +main() \ No newline at end of file