Last active
June 16, 2021 14:26
-
-
Save romainGuiet/9e0dee82690bcfa670edeadb7fdcae0a to your computer and use it in GitHub Desktop.
A ImageJ macro to create a standardized "User Project" folder. #BIOP #FIJI #Macro #UserProject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@File(label="Please select an UserName-Lab", style="directory") selected_dir | |
#@String() projectName | |
/* | |
* Macro to create a folder accordingly to BIOP template. | |
* | |
* | |
* | |
* git need to be installed | |
* | |
*/ | |
// the log is used to create a readme file, clear it to start | |
print("\\Clear"); | |
selected_dir += File.separator; | |
getDateAndTime(year, month, dayOfWeek, dayOfMonth, hour, minute, second, msec); | |
project_dir = selected_dir+projectName+"-"+year+"."+month+"."+dayOfMonth+File.separator; | |
print("#"+ projectName ); | |
print("Project creation"+ year+"."+month+"."+dayOfMonth ); | |
print(""); | |
exec("cmd","/c", "mkdir", project_dir); | |
exec("cmd","/c", "git init", project_dir); | |
File.makeDirectory(project_dir+File.separator+"code"); | |
File.makeDirectory(project_dir+File.separator+"data"); | |
File.makeDirectory(project_dir+File.separator+"results"); | |
// git ignore recursvely DATA | |
//README.MD | |
print("This is a project automatically created! Please do some documentation here..."); | |
print("-----" ); | |
saveAs("txt", project_dir+"README.md"); | |
rename_status = File.rename(project_dir+"README.txt", project_dir+"README.md"); | |
print(rename_status); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#ijm #project