Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forcing local repo checks for 'file://' prefixed repositories - issues/715 #760

Merged
merged 2 commits into from
Oct 29, 2021
Merged

Conversation

jbkc85
Copy link
Contributor

@jbkc85 jbkc85 commented Oct 13, 2021

No description provided.

@fiftin fiftin merged commit f1712dd into semaphoreui:develop Oct 29, 2021
@fiftin
Copy link
Collaborator

fiftin commented Oct 29, 2021

Thank you @jbkc85 !

@jbkc85
Copy link
Contributor Author

jbkc85 commented Nov 4, 2021

Thank you @jbkc85 !

not a problem @fiftin - I hope there was a way to test this out...I still have yet to be able to get all the javascript stuff up and running on my local machine :-(

t.fail()
return
if strings.HasPrefix(t.repository.GitURL, gitURLFilePrefix) {
repositoryPath := strings.TrimPrefix(gitURLFilePrefix, t.repository.GitURL)

Choose a reason for hiding this comment

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

Wrong way round, the prefix is the 2nd argument

https://pkg.go.dev/strings#TrimPrefix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh, seriously? I thought I had that appropriately set.

if strings.HasPrefix(t.repository.GitURL, gitURLFilePrefix) {
repositoryPath := strings.TrimPrefix(gitURLFilePrefix, t.repository.GitURL)
if _, err := os.Stat(repositoryPath); err != nil {
t.log("Failed in finding static repository at " + repositoryPath + ": " + err.Error())

Choose a reason for hiding this comment

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

Should fail() and return here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It should.

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.

3 participants