Skip to content

Commit

Permalink
fix(setup): remove xs-dev-export.sh sourcing from shell profile (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterBrown committed Aug 14, 2024
1 parent 2207a2f commit 268f180
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion docs/src/content/docs/features/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The [`moddable` git repo](https://github.com/Moddable-OpenSource/moddable) is cl

**Environment config:**

This command will create (and update) an environment configuration file called `~/.local/share/xs-dev-export.sh` (on Mac & Linux) or `Moddable.bat` (on Windows). This file will be placed in the shell setup file (`.profile`, `.zshrc`, `.bashrc`, etc on Mac & Linux) or the custom command prompt (on Windows), to set environment variables and call other "exports" files for embedded tooling.
This command will create (and update) an environment configuration file called `~/.local/share/xs-dev-export.sh` (on Mac & Linux) or `Moddable.bat` (on Windows). This file will be sourced by `xs-dev` when running commands (on Mac & Linux) or through the custom command prompt (on Windows), to set environment variables and call other "exports" files for embedded tooling.

## Target Branch

Expand Down
3 changes: 0 additions & 3 deletions src/toolbox/setup/esp32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ export default async function(): Promise<void> {
// 6. append 'source $IDF_PATH/export.sh' to shell profile
if (isWindows) {
await upsert(EXPORTS_FILE_PATH, `pushd %IDF_PATH% && call "%IDF_TOOLS_PATH%\\idf_cmd_init.bat" && popd`)
} else {
spinner.info('Sourcing esp-idf environment')
await upsert(EXPORTS_FILE_PATH, `source $IDF_PATH/export.sh 1> /dev/null`)
}

spinner.succeed(`
Expand Down
4 changes: 0 additions & 4 deletions src/toolbox/setup/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
INSTALL_DIR,
INSTALL_PATH,
EXPORTS_FILE_PATH,
getProfilePath,
XSBUG_LOG_PATH,
} from './constants'
import upsert from '../patching/upsert'
Expand Down Expand Up @@ -39,7 +38,6 @@ export default async function({ sourceRepo, targetBranch }: PlatformSetupArgs):
'makefiles',
'lin'
)
const PROFILE_PATH = getProfilePath()

const spinner = print.spin()
spinner.start('Beginning setup...')
Expand Down Expand Up @@ -111,8 +109,6 @@ export default async function({ sourceRepo, targetBranch }: PlatformSetupArgs):
process.env.MODDABLE = INSTALL_PATH
process.env.PATH = `${String(process.env.PATH)}:${BIN_PATH}`

await upsert(PROFILE_PATH, `source ${EXPORTS_FILE_PATH}`)

await upsert(EXPORTS_FILE_PATH, `export MODDABLE=${process.env.MODDABLE}`)
await upsert(EXPORTS_FILE_PATH, `export PATH="${BIN_PATH}:$PATH"`)

Expand Down
4 changes: 0 additions & 4 deletions src/toolbox/setup/mac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
INSTALL_DIR,
EXPORTS_FILE_PATH,
XSBUG_LOG_PATH,
getProfilePath,
} from './constants'
import upsert from '../patching/upsert'
import { downloadReleaseTools, fetchLatestRelease, MissingReleaseAssetError } from './moddable'
Expand Down Expand Up @@ -38,7 +37,6 @@ export default async function({ sourceRepo, targetBranch }: PlatformSetupArgs):
'makefiles',
'mac'
)
const PROFILE_PATH = getProfilePath()

// 0. ensure xcode command line tools are available (?)
try {
Expand Down Expand Up @@ -138,8 +136,6 @@ export default async function({ sourceRepo, targetBranch }: PlatformSetupArgs):
process.env.MODDABLE = INSTALL_PATH
process.env.PATH = `${String(process.env.PATH)}:${BIN_PATH}`

await upsert(PROFILE_PATH, `source ${EXPORTS_FILE_PATH}`)

await upsert(EXPORTS_FILE_PATH, `export MODDABLE=${process.env.MODDABLE}`)
await upsert(EXPORTS_FILE_PATH, `export PATH="${BIN_PATH}:$PATH"`)

Expand Down

0 comments on commit 268f180

Please sign in to comment.