forked from rtyley/agit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add web launch support for bitbucket.org
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
agit/src/main/java/com/madgag/agit/weblaunchers/BitBucketWebLaunchActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.madgag.agit.weblaunchers; | ||
|
||
import android.content.Intent; | ||
import android.net.Uri; | ||
|
||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
import static com.madgag.agit.CloneLauncherActivity.cloneLauncherIntentFor; | ||
import static java.util.regex.Pattern.compile; | ||
|
||
|
||
public class BitBucketWebLaunchActivity extends WebLaunchActivity { | ||
|
||
private static final String TAG = "WL-bitbucket"; | ||
|
||
private static final Pattern projectPathPattern = compile("^/([^/]+/[^/]+)"); | ||
|
||
Intent cloneLauncherForWebBrowseIntent(Uri uri) { | ||
Matcher matcher = projectPathPattern.matcher(uri.getPath()); | ||
matcher.find(); | ||
return cloneLauncherIntentFor("[email protected]:"+ matcher.group(1) +".git"); | ||
} | ||
} |