indent to line with module block

This commit is contained in:
2018-12-04 02:48:54 -07:00
parent 8ea5db169a
commit 4189916925

View File

@@ -11,85 +11,85 @@ module LibJprog
DEBUG = false # enable for verbose messages DEBUG = false # enable for verbose messages
# Generic directory checking with boolean returns # Generic directory checking with boolean returns
function check_dir(directory) function check_dir(directory)
if ispath(directory) if ispath(directory)
if DEBUG == true print("The directory: ", directory, " already exists\n") end if DEBUG == true print("The directory: ", directory, " already exists\n") end
return true return true
else else
if DEBUG == true print("The directory: ", directory, " does not exist\n") end if DEBUG == true print("The directory: ", directory, " does not exist\n") end
return false return false
end end
end
# Generic file checking with boolean returns
function check_file(filePath)
if isfile(filePath)
if DEBUG == true print("File: ", filePath, " exists\n") end
return true
else
if DEBUG == false print("File: ", filePath, " does not exist\n") end
return false
end
end
# Somewhat automate creating directories
function create_default_structure(projectDir)
local subDirs = ["src", "lib"]
for dirs in subDirs
mkpath("$projectDir/$dirs")
end end
# check whether projectDir contains / # Generic file checking with boolean returns
projectName = occursin(projectDir, "/" ) function check_file(filePath)
if DEBUG == true print(projectName, "\n") end if isfile(filePath)
# append name of project to main source file name if DEBUG == true print("File: ", filePath, " exists\n") end
projectName = projectDir[projectName+1:length(projectDir)] return true
else
touch("$projectDir/src/$projectName.jl") if DEBUG == false print("File: ", filePath, " does not exist\n") end
touch("$projectDir/README.md") return false
touch("$projectDir/LICENSE") end
end
# Establish a Git repository in project root
function git_init(projectPath)
init("$projectPath", false)
if check_dir("$projectPath/.git") != true
print("Failed to initialize git repository in: ", pwd(), "/$projectPath\n")
else
print("Git repository initialized\n")
end end
end
# Print a list of supported commands # Somewhat automate creating directories
function help() function create_default_structure(projectDir)
print("\n", "useage: jprog init <project name>", "\n", "\n")
print("init Create a new project\n") local subDirs = ["src", "lib"]
end for dirs in subDirs
# Get version information for this program mkpath("$projectDir/$dirs")
function version()
print("\n", "Version 1\n\n") end
end
end # check whether projectDir contains /
projectName = occursin(projectDir, "/" )
if DEBUG == true print(projectName, "\n") end
# append name of project to main source file name
projectName = projectDir[projectName+1:length(projectDir)]
touch("$projectDir/src/$projectName.jl")
touch("$projectDir/README.md")
touch("$projectDir/LICENSE")
end
# Establish a Git repository in project root
function git_init(projectPath)
init("$projectPath", false)
if check_dir("$projectPath/.git") != true
print("Failed to initialize git repository in: ", pwd(), "/$projectPath\n")
else
print("Git repository initialized\n")
end
end
# Print a list of supported commands
function help()
print("\n", "useage: jprog init <project name>", "\n", "\n")
print("init Create a new project\n")
end
# Get version information for this program
function version()
print("\n", "Version 1\n\n")
end
end