make mastodon installation faster in dev mode (#624)

This commit is contained in:
Nolan Lawson 2018-11-11 11:12:47 -08:00 committed by GitHub
parent 6bb4c80450
commit 00cafece8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -95,10 +95,18 @@ async function runMastodon () {
'yarn --pure-lockfile' 'yarn --pure-lockfile'
] ]
const installedFile = path.join(mastodonDir, 'installed.txt')
try {
await stat(installedFile)
console.log('Already installed Mastodon')
} catch (e) {
console.log('Installing Mastodon...')
for (let cmd of cmds) { for (let cmd of cmds) {
console.log(cmd) console.log(cmd)
await exec(cmd, { cwd, env }) await exec(cmd, { cwd, env })
} }
await writeFile(installedFile, '', 'utf8')
}
const promise = spawn('foreman', ['start'], { cwd, env }) const promise = spawn('foreman', ['start'], { cwd, env })
const log = fs.createWriteStream('mastodon.log', { flags: 'a' }) const log = fs.createWriteStream('mastodon.log', { flags: 'a' })
childProc = promise.childProcess childProc = promise.childProcess