Skip to content

Commit

Permalink
fix install
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Feb 2, 2018
1 parent cd45c21 commit cf0d726
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ cypress/screenshots
dist
.opt-in
.eslintcache
/client/other/shared
/server/other/shared
1 change: 0 additions & 1 deletion client/other/shared

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"eslint": "^4.16.0",
"eslint-config-kentcdodds": "^13.0.1",
"faker": "^4.1.0",
"fs-extra": "^5.0.0",
"husky": "^0.14.3",
"jest": "^22.1.2",
"lint-staged": "^6.0.1",
Expand Down
44 changes: 35 additions & 9 deletions scripts/install.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
/* eslint-disable */

var path = require('path')
var installDeps = require('./workshop-setup').installDeps
const path = require('path')
const fs = require('fs')
const installDeps = require('./workshop-setup').installDeps

ensureExists(path.resolve(__dirname, '../client/other'))
ensureExists(path.resolve(__dirname, '../server/other'))

symlinkDir(
path.resolve(__dirname, '../shared/'),
path.resolve(__dirname, '../client/other/shared')
)
symlinkDir(
path.resolve(__dirname, '../shared/'),
path.resolve(__dirname, '../server/other/shared')
)

const main = path.resolve(__dirname, '..')
const shared = path.resolve(__dirname, '../shared')
const server = path.resolve(__dirname, '../server')
const client = path.resolve(__dirname, '../client')

var main = path.resolve(__dirname, '..')
var shared = path.resolve(__dirname, '../shared')
var server = path.resolve(__dirname, '../server')
var client = path.resolve(__dirname, '../client')
installDeps([main, shared, server, client]).then(
function() {
() => {
console.log('👍 all dependencies installed')
},
function() {
() => {
// ignore, workshop-setup will log for us...
}
},
)

function symlinkDir(src, dest) {
if (!fs.existsSync(dest)) {
fs.symlinkSync(src, dest, 'dir')
}
}

function ensureExists(dir) {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
}
1 change: 0 additions & 1 deletion server/other/shared

This file was deleted.

0 comments on commit cf0d726

Please sign in to comment.