-
Notifications
You must be signed in to change notification settings - Fork 96
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
Display GitHub Pages URL after ng deploy #107
Closed
masaxsuzu
wants to merge
7
commits into
angular-schule:master
from
masaxsuzu:try-parse-pages-from-repo
+68
−1
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8cbf49d
Try parse GitHub Pages url from repo url
masaxsuzu 573a9d5
Fix a property name
masaxsuzu 825ff9d
Parse from url w/o .git suffix
masaxsuzu a10d268
Parse from url taht ends with slash
masaxsuzu 44532a4
Append space at end for empty pages url
masaxsuzu 353872b
Revert "Append space at end for empty pages url"
masaxsuzu fb60bf4
Stop using type `any`
masaxsuzu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ export const defaults = { | |
cname: undefined, | ||
dryRun: false, | ||
remote: 'origin', | ||
ghPagesUrl: '', | ||
git: 'git' | ||
}; |
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 |
---|---|---|
|
@@ -84,6 +84,61 @@ describe('engine', () => { | |
expect(finalOptions.repo).toMatch(/angular-schule\/angular-cli-ghpages/); | ||
}); | ||
|
||
it('should discover the github pages url from https repository url', async () => { | ||
const options = { | ||
repo: 'https://github.com/organisation/your-repo.git' | ||
}; | ||
const finalOptions = await engine.prepareOptions(options, logger); | ||
|
||
expect(finalOptions.ghPagesUrl).toBe( | ||
'https://organisation.github.io/your-repo' | ||
); | ||
}); | ||
|
||
it('should discover the github pages url from url w/o .git suffix', async () => { | ||
const options = { | ||
repo: 'https://github.com/organisation/your-repo' | ||
}; | ||
const finalOptions = await engine.prepareOptions(options, logger); | ||
|
||
expect(finalOptions.ghPagesUrl).toBe( | ||
'https://organisation.github.io/your-repo' | ||
); | ||
}); | ||
|
||
it('should discover the github pages url from url that ends with splash', async () => { | ||
const options = { | ||
repo: 'https://github.com/organisation/your-repo/' | ||
}; | ||
const finalOptions = await engine.prepareOptions(options, logger); | ||
|
||
expect(finalOptions.ghPagesUrl).toBe( | ||
'https://organisation.github.io/your-repo' | ||
); | ||
}); | ||
|
||
it('should discover the github pages url from ssh repository url', async () => { | ||
const options = { | ||
repo: '[email protected]:organisation/your-repo.git' | ||
}; | ||
const finalOptions = await engine.prepareOptions(options, logger); | ||
|
||
expect(finalOptions.ghPagesUrl).toBe( | ||
'https://organisation.github.io/your-repo' | ||
); | ||
}); | ||
|
||
it('should discover the github pages url from https repository url that contains with `.git`', async () => { | ||
const options = { | ||
repo: 'https://github.com/organisation/x.gity.git' | ||
}; | ||
const finalOptions = await engine.prepareOptions(options, logger); | ||
|
||
expect(finalOptions.ghPagesUrl).toBe( | ||
'https://organisation.github.io/x.gity' | ||
); | ||
}); | ||
|
||
/* | ||
// i was not able to somehow catch an error... :-( | ||
it('should should throw an exception, if remote url could not be discovered', async () => { | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably the prop should just be named
url
? @JohannesHoppe / @fmalcher what do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all: Thanks for the PR! It's a great start..🤗
Regarding this part:
I don't think this should be an option at all. There is no need to set this via options, it should be only shown in the output. Such a change would also make the overall PR smaller!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with your point:
There is no need to set this via options
.Anyway, I'll make another patch to apply the feedback.