MCPcopy Create free account
hub / github.com/breck7/scroll / initCommand

Method initCommand

scroll.js:18–60  ·  view source on GitHub ↗
(cwd)

Source from the content-addressed store, hash-verified

16class ScrollCli extends SimpleCLI {
17 welcomeMessage = `\n📜 WELCOME TO SCROLL (v${packageJson.version})`
18 async initCommand(cwd) {
19 // todo: use stamp for this.
20 const initFolder = {
21 ".gitignore": `*.html
22*.rss
23*.txt
24.*.js
25.*.css
26feed.xml`,
27 "header.scroll": `importOnly
28metaTags
29buildTxt
30buildHtml
31theme gazette
32homeButton
33leftRightButtons
34editButton
35printTitle`,
36 "feed.scroll": `buildRss
37printFeed All`,
38 "footer.scroll": `importOnly
39center
40editButton
41scrollVersionLink`,
42 "helloWorld.scroll": `tags All
43header.scroll
44thinColumn
45This is my first blog post using Scroll.
46
47****
48
49footer.scroll`,
50 "index.scroll": `title My Blog
51header.scroll
52printSnippets All
53footer.scroll`
54 }
55
56 this.log(`Initializing scroll in "${cwd}"`)
57 Disk.writeObjectToDisk(cwd, initFolder)
58 require("child_process").execSync("git init", { cwd })
59 return this.log(`\n✅ Initialized new scroll in '${cwd}'. Build your new site with: scroll build`)
60 }
61
62 async scrollToHtml(scrollCode) {
63 const file = this.sfs.newFile(scrollCode)

Callers 1

scroll.test.jsFile · 0.80

Calls 1

logMethod · 0.80

Tested by

no test coverage detected