           mix weber.new /home/user/testWebApp -- creates new weber web application
           mix weber --version -- shows weber version
           mix weber --help    -- show weber help
-          mix weber --run     -- runs current weber web application
         """
     end
 


       Usage:

         mix weber /home/user/myWebApp - Creates myWebApp directory with weber project skeleton.
         mix weber --version - Prints weber version.
    """


            # create project skeleton
            #
            path = absname directoryName
            baseName = basename directoryName

            vars = HashDict.new [
                {"path", path},
                {"proj", String.capitalize(baseName)},
                {"projectName", baseName}
            ]

            # TODO: do we need multiple app templates?
            template = "default"
            {:ok, pwd} = cwd
            skelRoot = pwd <> "/templates/" <> template
            cd skelRoot
            skelFiles = String.split(System.cmd("find -P . -mindepth 1"), "\n", [])
            lc file inlist skelFiles, file != "" do
                baseFile = String.slice(file, 1, 1024)
                # TODO: fix to allow >1 variables in file name
                destination = case Regex.captures(%r/.*\#\{(?<key>.+)\}.*/g, baseFile) do
                    nil        -> path <> baseFile
                    [key: key] -> path <> Regex.replace(%r/\#\{.+\}/, baseFile, HashDict.get(vars, key))
                end
                case dir?(file) do
                    true  -> create_directory destination
                    false -> (
                        cp file, destination, fn _, _ -> true end
                        {:ok, origin} = read destination
                        compiled = (
                            case Enum.uniq(Regex.scan(%r/\#\{([^\}]+)\}/, origin)) do
                                []   -> origin
                                data -> replacer(origin, vars, data)
                            end
                        )
                        write destination, compiled, []
                    )
                end
            end
        end

        defp replacer(text, vars, []) do
            text
        end
        defp replacer(text, vars, [[entry, key] | tail]) do
           replacer(String.replace(text, entry, HashDict.get(vars, key), []), vars, tail)
        end

    end

end