Skip to content

Conversation

@lloydchang
Copy link
Contributor

No description provided.

@lloydchang
Copy link
Contributor Author

lloydchang commented Nov 14, 2024

Relates to Implement additional gemini backend #84
create onboarding/quickstart blog post as well as video #36
docs(README.md): add Mac use case #95

@andreashappe
Copy link
Member

I will merge this for now.. would it be possible to move some of the shell-script functions into a common shellscript and include this from the different scripts (similar to a library)?

@andreashappe andreashappe merged commit 6ee3f10 into ipa-lab:main Nov 14, 2024
1 check passed
@lloydchang
Copy link
Contributor Author

lloydchang commented Nov 14, 2024

Thank you for merging.

Refactoring the functions for Mac and Linux into a library seems like premature optimization to me:

  • Since Mac (which is BSD-based) and Codespaces (which is Linux) don't share a common underlying platform, it can be challenging to reuse and share code between them.

  • Additionally, the two shell scripts on Mac may not operate in the same shell environment, as they could be using different versions of Bash—version 5 from Homebrew versus version 3 from Apple.

@lloydchang
Copy link
Contributor Author

lloydchang commented Nov 23, 2024

Update: As an experiment, I used Cline (AI Agent) and Gemini (LLM) with the following prompt:

would it be possible to move some of the shell-script functions into a common shellscript and include this from the different scripts (similar to a library)?

Cline and Gemini refactored by creating a new file, common_function.sh, while editing existing files.

I tried running the outputted files in Codespaces and Mac, but I encountered compatibility issues due to conflicting syntax and different *nix utilities between the two operating systems, Ubuntu Linux versus macOS.

To mitigate that, I tried to add conditional statements to differentiate Linux versus Mac in common_function.sh.

  • Ironically, adding conditionals undermines the purpose of naming the file common_functions.sh in the first place.

  • Thus, I don't think common_functions.sh is worth the return on investment nor additional time required to try refactoring.

--

Visibility:

If the concern is about too many files in root directory, perhaps existing files are movable into sub-directories to differentiate between Codespaces versus Mac.

--

Clarification:

Within each environment—Codespaces or Mac—there are two shell scripts because there are two different entry points:

  1. Start containers at initialization:

    • create_and_start_containers

versus

  1. Start hackingBuddyGPT, the app, at run-time:

    • start_hackingbuddygpt

@andreashappe
Copy link
Member

yes, moving those scripts, e.g., into /scripts might improve readability.. could you do that?

Using different bash/zsh versions: yes, this is a problem (but this is already a problem now too.. shouldn't we include sanity checks in the different scripts that the expected bash version is the currently used version?

@lloydchang lloydchang mentioned this pull request Dec 3, 2024
@lloydchang
Copy link
Contributor Author

yes and yes at #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants