uber / uber/RIBs

[ios/tooling] the install-xcode-template fails if file permissions aren't exactly as expected

Open
#293 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

iOS
Dominant language
Kotlin
Stars
7.9k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

It looks like the bash script has no error handling, so when mkdir fails the script isn't able to copy over the templates. Due to the lack of error handling the script still thinks it succeeded

👋 ./ios/tooling/install-xcode-template.sh                                                               (🙈) ~/Developer/ribs💻 
==> Copying up RIBs Xcode file templates...
mkdir: /Applications/xcode_10_fb.app/Templates/File Templates/RIBs: Permission denied
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
==> ... success!
==> RIBs have been set up. In Xcode, select 'New File...' to use RIBs templates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ios/tooling/install-xcode-template.sh and reproduce the failure when creating the Xcode template directory lacks permission. Trace how mkdir and cp failures affect the script's final status. Done means a failed setup is reported as unsuccessful instead of printing success after the copy steps fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
mobile, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.