Skip to content

Commit

Permalink
chore(client): add additional params
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Sep 22, 2022
1 parent 15e6595 commit 0798cc6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: placeos-frontend-loader
version: 2.5.2
version: 2.5.3

authors:
- Caspian Baska <[email protected]>
Expand Down
13 changes: 11 additions & 2 deletions src/placeos-frontend-loader/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,19 @@ module PlaceOS::FrontendLoader
end

# Commits for a remote repository
def remote_commits(repository_url : String, branch : String, username : String? = nil, password : String? = nil)
def remote_commits(
repository_url : String,
branch : String? = nil,
file : String? = nil,
depth : Int32? = nil,
username : String? = nil,
password : String? = nil
)
encoded_url = URI.encode_www_form(repository_url)
params = URI::Params.build do |form|
form.add("branch", branch)
form.add("file", file.to_s) if file.presence
form.add("depth", depth.to_s) if depth
form.add("branch", branch.to_s) if branch.presence
form.add("username", username.to_s) if username.presence
form.add("password", password.to_s) if password.presence
end
Expand Down

0 comments on commit 0798cc6

Please sign in to comment.