Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Allow repos as filepaths in sail run #198

Merged
merged 1 commit into from
Jul 1, 2019
Merged

Allow repos as filepaths in sail run #198

merged 1 commit into from
Jul 1, 2019

Conversation

coadler
Copy link
Contributor

@coadler coadler commented May 24, 2019

This is one half of #72

Allows users to specify a location on disk when running a sail repo.

cd ~/Projects/cdr/code-server
sail run .

cd ~/Projects/cdr
sail run code-server

It will error if you specify a folder outside of the project directory

Note: currently specifying a subdirectory of a project will default to opening the base directory of the project.

@coadler coadler mentioned this pull request May 24, 2019
@deansheather
Copy link
Member

@nathanpotter Cold you please review this?

@nathanpotter
Copy link
Contributor

@coadler is this ready for review? I thought we were waiting for the other half to be implemented or we had decided not to do it a while ago, I can't remember

@coadler
Copy link
Contributor Author

coadler commented Jul 1, 2019

I made a comment on the original issue to figure out how we want to handle some default behavior which I felt needed to be answered before we tackle the other part. It unfortunately didn't get any comments :D. This should be good though

globalflags.go Outdated
return r
}

// pathIsRunnable returns the container name if the given path exists and is
// in the projects directory, else an empty string An error is returned if
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// in the projects directory, else an empty string An error is returned if
// in the projects directory. Otherwise an empty string and an error is returned if

Copy link
Contributor Author

@coadler coadler Jul 1, 2019

Choose a reason for hiding this comment

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

It's possible for an empty string and a nil error to be returned if the path doesn't exist inside of the projects directory. The error is only if the specified directory exists and is outside of the projects directory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I misunderstood, imo the error is more of a separate thought

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok that sounds good, then I guess just a . is needed after else an empty string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh oops

@@ -16,6 +16,7 @@ import (

type repo struct {
*url.URL
subdir string
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to open code-server to the subdirectory, are we planning to handle that in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah see #72 (comment). Right now it just always defaults to the base directory of the project

Copy link
Contributor

@nathanpotter nathanpotter left a comment

Choose a reason for hiding this comment

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

LGTM, just needs the updated comment and rebase

@coadler coadler merged commit aa11bec into master Jul 1, 2019
@coadler coadler deleted the specify-folder branch July 1, 2019 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants