uber / uber/RIBs-iOS

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

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
193
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Original issue: https://github.com/uber/RIBs/issues/293

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 reported permission-denied case against an Xcode installation whose template directory is not writable. Trace how mkdir and cp failures are handled; done means the script reports failure and does not print success when setup did not complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
mobile-dev, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.