-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
85 lines (75 loc) · 2.67 KB
/
index.js
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
77
78
79
80
81
82
83
84
85
// Importing fs for file system excessibility
const fs = require('fs');
// exporting html5Private function as html5Public
exports.cPublic = cPrivate;
exports.mPublic = mPrivate;
exports.ccPublic = ccPrivate;
exports.javaPublic = javaPrivate;
exports.py3Public = py3Private;
exports.flaskPublic = flaskPrivate;
exports.html5Public = html5Private;
exports.css3Public = css3Private;
exports.appjsPublic = appjsPrivate;
function cPrivate() {
// Reading c boilerplate
const c = fs.readFileSync(`${__dirname}/main_files/main.c`);
const filename = process.argv[2];
// Writing c to file
fs.writeFileSync(`${process.cwd()}/${filename}`, c);
}
function mPrivate() {
// Reading objective-c boilerplate
const m = fs.readFileSync(`${__dirname}/main_files/main.m`);
const filename = process.argv[2];
// Writing objective-c to file
fs.writeFileSync(`${process.cwd()}/${filename}`, m);
}
function ccPrivate() {
// Reading c++ boilerplate
const cc = fs.readFileSync(`${__dirname}/main_files/main.cc`);
const filename = process.argv[2];
// Writing c++ to file
fs.writeFileSync(`${process.cwd()}/${filename}`, cc);
}
function javaPrivate() {
// Reading java boilerplate
const java = fs.readFileSync(`${__dirname}/main_files/main.java`);
const filename = process.argv[2];
// Writing java to file
fs.writeFileSync(`${process.cwd()}/${filename}`, java);
}
function py3Private() {
// Reading python boilerplate
const py3 = fs.readFileSync(`${__dirname}/main_files/main.py`);
const filename = process.argv[2];
// Writing python to file
fs.writeFileSync(`${process.cwd()}/${filename}`, py3);
}
function flaskPrivate() {
// Reading python flask boilerplate
const flask = fs.readFileSync(`${__dirname}/main_files/flask.py`);
const filename = process.argv[2];
// Writing python flask to file
fs.writeFileSync(`${process.cwd()}/${filename}`, flask);
}
function html5Private() {
// Reading html5 boilerplate
const html5 = fs.readFileSync(`${__dirname}/main_files/index.html`);
const filename = process.argv[2];
// Writing html5 to file
fs.writeFileSync(`${process.cwd()}/${filename}`, html5);
}
function css3Private() {
// Reading css3 boilerplate
const css3 = fs.readFileSync(`${__dirname}/main_files/index.css`);
const filename = process.argv[2];
// Writing css3 to file
fs.writeFileSync(`${process.cwd()}/${filename}`, css3);
}
function appjsPrivate() {
// Reading nodejs boilerplate
const appjs = fs.readFileSync(`${__dirname}/main_files/app.js`);
const filename = process.argv[2];
// Writing nodejs to file
fs.writeFileSync(`${process.cwd()}/${filename}`, appjs);
}