Skip to content

Improvements on #24#30

Merged
albertodebortoli merged 34 commits intofeature/13-stellar-envfrom
feature/13-stellar-env-alberto
Mar 6, 2023
Merged

Improvements on #24#30
albertodebortoli merged 34 commits intofeature/13-stellar-envfrom
feature/13-stellar-env-alberto

Conversation

@albertodebortoli
Copy link
Member

I would like to suggest some improvements iteratively as I go through the code of PR #24 as it's quite big and I'm wrapping my head around every file.

Not many changes but I strongly advise inspecting each commit individually as the titles will help.

This PR addresses the comments left on #24.

Thanks @malcommac <3

@albertodebortoli albertodebortoli added the enhancement New feature or request label Mar 1, 2023
@albertodebortoli albertodebortoli added this to the 0.1.0 milestone Mar 1, 2023
@albertodebortoli albertodebortoli force-pushed the feature/13-stellar-env-alberto branch from 8eb1d95 to 17a673e Compare March 4, 2023 20:42
@albertodebortoli albertodebortoli force-pushed the feature/13-stellar-env-alberto branch from 17a673e to 696d0a9 Compare March 4, 2023 20:45
matrix:
macos: ['macos-12']
xcode: ['14.1.0']
macos: ['macos-13']
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too confident about this anymore as GitHub Actions has been hanging for more than 3 hours 🤔

image

@malcommac
Copy link
Contributor

@albertodebortoli, great idea to move the install.sh on a separate script.

To summarize, you were unable to test the following:

  • fetch remote releases
  • forward operation from ENV to CLI

Right?
Did the installation (of the env and CLI) work for you?

ASSET_URL=$(ruby ./assets_url.rb "${JSON}")

ohai "Downloading stellarenv [$ASSET_URL]"
ASSETS_URL=$(ruby ./assets_url.rb "${JSON}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? It just returns the URL of a single asset, the URL of the StellarEnv asset.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm not sure :D
I thought it was desired to have it in line with the file. Maybe asset_url.rb (singular) then?


// Unzip the file
try Shell.shared.unzip(fileURL: remoteFileURL, destinationURL: installURL)
NSWorkspace.shared.activateFileViewerSelecting([installURL])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we should disable it or make it dependent on a --debug command or similar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that the file is opened in Finder only if --debug is used? I was thinking the same.

if let version {
url = url.appendingPathComponent(version)
/// - Returns: a URL to the folder containing the installed versions
func systemVersionsLocation() throws -> URL {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe CLIToolsVersions() is a better name to be consistent with the other code?

Copy link
Member Author

@albertodebortoli albertodebortoli Mar 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since they all end with either 'location' or 'url' and return URL, maybe we could name these 3 methods:

func homeStellarLocation(subfolder: String? = nil) -> URL
func cliVersionsLocation() throws -> URL
func cliLocation(for version: String) throws -> URL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ok, I pushed fe82f78.

import Foundation
import StellarCore

@main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this code on the first refactor some days ago (on #24), but it broke the forward operation. Did you notice the comment on main.swift? Have you found a fix on it/does forward still work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the comment in main.swift and I think I misunderstood it. That's a bummer, we need to find a way around this or stellarenv won't leverage Argument Parser. I'm confident we will given that Tuist does it.
I've reverted 33f6b08 for now.

@albertodebortoli albertodebortoli merged commit c3e2f7b into feature/13-stellar-env Mar 6, 2023
@albertodebortoli albertodebortoli deleted the feature/13-stellar-env-alberto branch March 6, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants