expo / turtle

Standalone app builder service
MIT License
385 stars 29 forks source link

Turtle is overwriting some env vars #223

Closed dacevedo12 closed 4 years ago

dacevedo12 commented 4 years ago

New Issue Checklist

Issue Description

setting TURTLE_WORKING_DIR_PATH does not work because this function (https://github.com/expo/turtle/blob/master/bin/turtle.js#L25) makes it run "offline" and replaces it every time with $HOME/.turtle/workingdir/ (https://github.com/expo/turtle/blob/master/src/bin/env.ts#L43)

I'm working on a caching strategy for our CI/CD and want to use that variable to specify the directory where the shell app downloaded by turtle setup:android will be.

I also noticed that if it wasn't because of this, it wouldn't point to $HOME because of the default value it currently has: https://github.com/expo/turtle/blob/master/src/config.ts#L78

Command executed

// Setup job export TURTLE_WORKING_DIR_PATH="my/custom/location" turtle setup:android --sdk-version 37.0.0 // Build job export TURTLE_WORKING_DIR_PATH="my/custom/location" turtle build:android

Environment

  Expo CLI 3.20.1 environment info:
    System:
      OS: Linux 4.15 Deepin 15 15.11
      Shell: 4.4.12 - /bin/bash
    Binaries:
      Node: 10.20.1 - /usr/bin/node
      Yarn: 1.22.4 - /usr/bin/yarn
      npm: 6.14.4 - /usr/bin/npm
    npmPackages:
      expo: 37.0.8 => 37.0.8 
      react: 16.9.0 => 16.9.0 
      react-dom: 16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4 
wkozyra95 commented 4 years ago

TURTLE_WORKING_DIR_PATH is not intended to be user-facing, we used it configure builds for server and local builds. I would suggest just creating a symlink to $HOME/.turtle, but if you really need this you can create PR with changes.

dacevedo12 commented 4 years ago

I didn't know that, thanks. I ended up using the symlink approach you suggested