bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.13k stars 114 forks source link

Apply command doesn't respect branches on transform #65

Closed KonnorRogers closed 4 years ago

KonnorRogers commented 4 years ago

When supplying a branch such as "automation" or "development" to the bridgetown apply command, it appends "master"

Bridgetown Version:

0.15.0.beta-2

Current Behavior:

bridgetown apply https://github.com/ParamagicDev/bridgetown-plugin-tailwindcss/tree/automation/bridgetown.automation.rb

Turns

"https://github.com/ParamagicDev/bridgetown-plugin-tailwindcss/tree/automation/bridgetown.automation.rb"

into

"https://raw.githubusercontent.com/ParamagicDev/bridgetown-plugin-tailwindcss/automation/master/bridgetown.automation.rb"

Expected Behavior

"https://github.com/ParamagicDev/bridgetown-plugin-tailwindcss/tree/automation/bridgetown.automation.rb"

Should turn to

"https://raw.githubusercontent.com/ParamagicDev/bridgetown-plugin-tailwindcss/automation/bridgetown.automation.rb"

jaredcwhite commented 4 years ago

Thanks @ParamagicDev — the fancy GitHub URL parsing is indeed not accounting for paths in non-master branches. Good catch.

jaredcwhite commented 4 years ago

Actually, if you're feeling inspired, maybe you could add a PR with some failing examples in the test (bridgetown-core/test/test-apply-command.rb), and I'd love to pair on fixes … should go into 0-15-stable branch

KonnorRogers commented 4 years ago

I added a test for it...and i couldnt help but solve the issue as well...I submitted a PR

66

jaredcwhite commented 4 years ago

Done, now available in 0.15.0.beta3 public release.