Skip to content

Commit

Permalink
add start and swap scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Jul 17, 2023
1 parent d201eb2 commit f5c76e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/setup-swap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node

import { $ } from 'execa'
import { writeFile } from 'node:fs/promises'

console.log('setting up swapfile...')
await $`fallocate -l 512M /swapfile`
await $`chmod 0600 /swapfile`
await $`mkswap /swapfile`
await writeFile('/proc/sys/vm/swappiness', '10')
await $`swapon /swapfile`
await writeFile('/proc/sys/vm/overcommit_memory', '1')
console.log('swapfile setup complete')
2 changes: 2 additions & 0 deletions scripts/start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './setup-swap.js'
import '@kentcdodds/workshop-app/start'

0 comments on commit f5c76e8

Please sign in to comment.