Skip to content

Commit

Permalink
fix(command-dev): set the log location for traffic mesh explicitly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
calavera authored Sep 17, 2020
1 parent c9ae248 commit 431654e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ const getPathInHome = paths => {
return pathInHome
}

module.exports = { getPathInHome }
const getPathInProject = paths => {
const pathInProject = path.join(NETLIFY_HOME, ...paths)
return pathInProject
}

module.exports = { getPathInHome, getPathInProject }
4 changes: 2 additions & 2 deletions src/utils/state-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const makeDir = require('make-dir')
const fs = require('fs')
const writeFileAtomic = require('write-file-atomic')
const dotProp = require('dot-prop')

const STATE_PATH = path.join('.netlify', 'state.json')
const { getPathInProject } = require('../lib/settings')
const STATE_PATH = getPathInProject(['state.json'])
const permissionError = "You don't have access to this file."

class StateConfig {
Expand Down
4 changes: 3 additions & 1 deletion src/utils/traffic-mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')
const execa = require('execa')
const waitPort = require('wait-port')
const { NETLIFYDEVLOG, NETLIFYDEVERR } = require('./logo')
const { getPathInHome } = require('../lib/settings')
const { getPathInHome, getPathInProject } = require('../lib/settings')
const { shouldFetchLatestVersion, fetchLatestVersion } = require('../lib/exec-fetcher')

const PACKAGE_NAME = 'traffic-mesh-agent'
Expand Down Expand Up @@ -44,6 +44,8 @@ const startForwardProxy = async ({ port, frameworkPort, functionsPort, projectDi
`http://localhost:${frameworkPort}`,
'--watch',
projectDir,
'--log-file',
getPathInProject(['logs', 'traffic-mesh.log']),
]

if (functionsPort) {
Expand Down

0 comments on commit 431654e

Please # to comment.