{"id":26666374,"url":"https://github.com/smbcheeky/update-env","last_synced_at":"2026-04-10T21:06:06.924Z","repository":{"id":283903484,"uuid":"953246248","full_name":"SMBCheeky/update-env","owner":"SMBCheeky","description":"Simplify the management of environment configuration and files for Expo React Native projects that use EAS Build.","archived":false,"fork":false,"pushed_at":"2025-03-22T22:52:01.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T23:26:23.896Z","etag":null,"topics":["eas","env","environment","environment-variables","expo","react-native"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SMBCheeky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T22:42:02.000Z","updated_at":"2025-03-22T22:57:41.000Z","dependencies_parsed_at":"2025-03-22T23:26:30.468Z","dependency_job_id":"b242df29-9f0e-4d74-a5c4-684ee9f67dbd","html_url":"https://github.com/SMBCheeky/update-env","commit_stats":null,"previous_names":["smbcheeky/update-env"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMBCheeky%2Fupdate-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMBCheeky%2Fupdate-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMBCheeky%2Fupdate-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMBCheeky%2Fupdate-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMBCheeky","download_url":"https://codeload.github.com/SMBCheeky/update-env/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245518568,"owners_count":20628554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eas","env","environment","environment-variables","expo","react-native"],"created_at":"2025-03-25T18:26:09.247Z","updated_at":"2026-04-10T21:06:06.877Z","avatar_url":"https://github.com/SMBCheeky.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub last commit](https://img.shields.io/github/last-commit/smbcheeky/update-env)](https://github.com/smbcheeky/update-env)\n[![GitHub stars](https://img.shields.io/github/stars/smbcheeky/update-env)](https://img.shields.io/github/stars/smbcheeky/update-env)\n\n## Description\n\nThis script was initially created to manage the environment configuration and secrets of any file-based project.\n\nIt allows the developer to exclude sensitive files from git version control and help keep every environment folder\norganized with relative paths, similar to the root project.\n\nThe script conditionally includes special treatment for development with React Native and Expo, but can be easily\nadjusted to ignore this part.\n\n## Expo, React Native, EAS Build and .easignore\n\nThe EAS Build process uses the contents of .gitignore file to determine which files to include in the created JS bundle.\nIf however the files are excluded from git version control, they are not included in the bundle unless they are\nexplicitly included via the .easignore file.\n\nIf Expo is detected, the .easignore file will be automatically updated and the environment files entries will be\nincluded in the EAS Build process and still kept outside git version control.\n\n## How does it work?\n\n```bash\nchmod +x ./update-env.sh\n./update-env.sh production\n```\n\n1. Copy the `update-env.sh` script to the root of the project\n2. The script checks for the existence of the `.environment` folder in the root of the project\n3. If the `.environment` folder exists, it checks for the existence of the `production` subfolder\n4. It makes sure all files that need to be included in git version control are included, and all files that are not, are\n   excluded.\n5. It overrides the project files with the ones found in the `production` subfolder\n6. To make sure everything is copied correctly, the `production` subfolder needs uses the same folder structure as the\n   root project directory.\n7. Once copied, the .gitignore file is updated to include the new entries\n8. .gitignore changes that are managed by the script are organized neatly in a special section inside the .gitignore\n   file\n9. If Expo app.json, app.config.js or app.config.ts files are found, the .easignore file is also created and updated\n   based on the .gitignore file with \"a twist\"\n10. The environment files that are ignored in the .gitignore file are now included in the .easignore file.\n11. .gitignore and .easignore existing entries are kept unchanged\n12. The `update-env.lock` file is created to keep track of the changes made by the script and to make sure when changes\n    are made, it is visible in git version control\n13. If you want to add more files to the .gitignore file, but have them managed by the script, you can add them to\n    the `update-env.ignore` file\n\n## Setup example\n\n- This setup is meant for two environments, `production` and `staging`\n- Add the `use-production` and `use-staging` scripts to your `package.json` file\n- Create a `.environment` folder in the root of your project\n- Create a `production` folder in the `.environment` folder\n- Add production files to the `production` folder while respecting the same relative path structure as the root project\n- Run `./update-env.sh production` to update the project\n- Create a `staging` folder in the `.environment` folder\n- Add staging files to the `staging` folder while respecting the same relative path structure as the root project\n- Run `./update-env.sh staging` to update the project\n\n## Other notes\n\n- The script can work with only one environment\n- The `.ignored` folder is meant to be used as is and is useful for case where you need to use a secret/certificate, but\n  it is not linked to the project files\n- If you want to include a file in multiple environments, use copy and paste to add it manually to each one :) Trust me,\n  it's better this way.\n- Environments are determined by the subfolders present in the `.environment` folder\n- An example archive of the `.environment` folder was committed along with the script\n- There are 2 environments added, `production` and `staging` + a generic `.ignored` folder\n- The `update-env.ignore` file is currently populated with entries used in Expo React Native projects\n- The `update-env.lock` file is updated during the script execution, and used similar to a log file\n- The `#.gitignore file placeholder` and `#.easignore file placeholder` are simple lines added to take place of existing\n  lines in both files - they are used simply as part of the example and can be deleted","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmbcheeky%2Fupdate-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmbcheeky%2Fupdate-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmbcheeky%2Fupdate-env/lists"}