1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/*
* Created on Thu Oct 17 08:00:42 CEST 2024
*
* Copyright (c) 2024 Amlal EL Mahrouss
*/
#include <Framework.h>
#include <Steps.h>
#include <LibCF/Array.h>
/// @brief This program makes a framework directory for NeKernel OS.
int main(int argc, char* argv[])
{
LibCF::CFArray<const char*, 255> files;
auto ext = kFKExtension;
for (SizeT i = 2UL; i < argc; ++i)
{
if (MmStrCmp(argv[i], "-h") == 0)
{
MsgAlloc(kAlertMsg);
MsgSend(kAlertMsg, "%s", "make_app: Framework/Application Creation Tool.\n");
MsgSend(kAlertMsg, "%s", "make_app: © Amlal EL Mahrouss, All rights reserved.\n");
MsgSend(kAlertMsg, "%s", "make_app: -a: Application format.\n");
MsgSend(kAlertMsg, "%s", "make_app: -s: Steps (Setup pages) format.\n");
MsgSend(kAlertMsg, "%s", "make_app: -f: Framework format.\n");
MsgShow(kAlertMsg);
MsgFree(kAlertMsg);
return EXIT_SUCCESS;
}
if (MmStrCmp(argv[i], "-a") == 0)
{
ext = kAppExtension;
continue;
}
else if (MmStrCmp(argv[i], "-s") == 0)
{
ext = kStepsExtension;
continue;
}
else if (MmStrCmp(argv[i], "-f") == 0)
{
ext = kFKExtension;
continue;
}
files[i] = argv[i];
}
auto path = argv[1];
if (FsCreateDir(path))
{
FsCreateDir(StrFmt("{}{}", path, kRootDirectory));
FsCreateDir(StrFmt("{}{}", path, kExecDirectory));
for (SInt32 i = 0; i < files.Count(); ++i)
{
auto& file = files[i];
FsCopy(path, StrFmt("{}{}", path, file));
}
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
|