no message

This commit is contained in:
2024-10-14 12:14:01 +03:00
parent 3a29898d5f
commit 452c4c7268
466 changed files with 1255 additions and 1100 deletions

View File

@@ -0,0 +1,52 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.GlobalData.User.UserState;
import _VisualDVM.Passes.ProcessPass;
import org.apache.commons.io.FileUtils;
import java.io.File;
public class LocalInitaliseUser extends ProcessPass<User> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = Global.mainModule.getUser();
return true;
}
@Override
protected void body() throws Exception {
File workspace = new File(Utils_.getHomeDirectory(), "User");
target.workspace = workspace.getAbsolutePath();
Utils.CheckAndCleanDirectory(workspace);
FileUtils.forceMkdir(target.getLocalProjectsDir());
FileUtils.forceMkdir(target.getLocalModulesDir());
//-
if (!Utils_.isWindows()) {
File headerCode = target.getHeaderCodeFile();
//-
File starterCode = target.getStarterCodeFile();
//-
File launcherCode = target.getLauncherCodeFile();
//-
Utils.CreateResourceFile(headerCode);
Utils.CreateResourceFile(starterCode);
Utils.CreateResourceFile(launcherCode);
//-
PerformScript(
String.join("\n",
"cd " + Utils_.DQuotes(target.getLocalModulesDir()),
"g++ starter -o starter",
"chmod 0777 starter"
));
PerformScript(String.join("\n",
"cd " + Utils_.DQuotes(target.getLocalModulesDir()),
"g++ launcher.cpp -o launcher",
"chmod 0777 launcher"
));
}
//-
target.state = UserState.ready_to_work;
Global.mainModule.getDb().Update(target);
}
}