create-sip 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/create-sip.js +1 -1
- package/manager.js +7 -14
- package/package.json +1 -1
- package/genHtml.js +0 -23
package/README.md
ADDED
package/create-sip.js
CHANGED
package/manager.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const dir = path.join(__dirname);
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
const genWebpage = (target) => {
|
|
7
|
-
|
|
8
|
-
createFile(`${target}/index.html`, genHtml);
|
|
9
|
-
createFile(`${target}/style.css`, '');
|
|
7
|
+
copyDir('webpage', target);
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const createDirectory = (path) => {
|
|
19
|
-
if (!fsExtra.existsSync(path)) {
|
|
20
|
-
fsExtra.mkdirSync(path);
|
|
10
|
+
const copyDir = (srcDir, destDir) => {
|
|
11
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
12
|
+
for (const file of fs.readdirSync(`${dir}/${srcDir}`)) {
|
|
13
|
+
fs.copyFileSync(`${dir}/${srcDir}/${file}`, `${destDir}/${file}`);
|
|
21
14
|
}
|
|
22
15
|
}
|
|
23
16
|
|
package/package.json
CHANGED
package/genHtml.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const htmlContent = `
|
|
3
|
-
<!DOCTYPE html>
|
|
4
|
-
<html lang="hu">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<title>Sinto Project</title>
|
|
9
|
-
<link rel="stylesheet" href="bootstrap.css">
|
|
10
|
-
<link rel="stylesheet" href="style.css">
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<div class="container">
|
|
14
|
-
<h1>Sinto Project</h1>
|
|
15
|
-
<p>This is a default index.html file, which was created by the sin command.</p>
|
|
16
|
-
</div>
|
|
17
|
-
<script type="module" src="app.js"></script>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
|
20
|
-
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
module.exports = htmlContent
|