mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-15 09:46:24 -04:00
Merge pull request #74 from paulirish/shellcheck
Add Shellcheck to CI tests
This commit is contained in:
commit
abd822a486
|
|
@ -1,5 +1,11 @@
|
|||
language: node_js
|
||||
node_js: "node"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- debian-sid # Grab ShellCheck from the Debian repo
|
||||
packages:
|
||||
- shellcheck
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
|
@ -9,4 +15,6 @@ script:
|
|||
- npm run lint:package
|
||||
- npm run lint:readme
|
||||
- npm run lint:editorconfig
|
||||
- shellcheck git-open
|
||||
|
||||
|
||||
|
|
|
|||
12
git-open
12
git-open
|
|
@ -55,12 +55,12 @@ branch=${branch//%/%25} && branch=${branch//#/%23}
|
|||
|
||||
# URL normalization
|
||||
# GitHub gists
|
||||
if grep -q gist.github <<<$giturl; then
|
||||
if grep -q gist.github <<<"$giturl"; then
|
||||
giturl=${giturl/git\@gist.github\.com\:/https://gist.github.com/}
|
||||
providerUrlDifference=tree
|
||||
|
||||
# GitHub
|
||||
elif grep -q github <<<$giturl; then
|
||||
elif grep -q github <<<"$giturl"; then
|
||||
giturl=${giturl/git\@github\.com\:/https://github.com/}
|
||||
|
||||
# handle SSH protocol (links like ssh://git@github.com/user/repo)
|
||||
|
|
@ -69,7 +69,7 @@ elif grep -q github <<<$giturl; then
|
|||
providerUrlDifference=tree
|
||||
|
||||
# Bitbucket
|
||||
elif grep -q bitbucket <<<$giturl; then
|
||||
elif grep -q bitbucket <<<"$giturl"; then
|
||||
giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/}
|
||||
# handle SSH protocol (change ssh://https://bitbucket.org/user/repo to https://bitbucket.org/user/repo)
|
||||
giturl=${giturl/#ssh\:\/\/git\@/https://}
|
||||
|
|
@ -83,7 +83,7 @@ elif grep -q bitbucket <<<$giturl; then
|
|||
branch="?at=${branch}"
|
||||
|
||||
# Atlassian Bitbucket Server
|
||||
elif grep -q "/scm/" <<<$giturl; then
|
||||
elif grep -q "/scm/" <<<"$giturl"; then
|
||||
re='(.*)/scm/(.*)/(.*)\.git'
|
||||
if [[ $giturl =~ $re ]]; then
|
||||
giturl=${BASH_REMATCH[1]}/projects/${BASH_REMATCH[2]}/repos/${BASH_REMATCH[3]}
|
||||
|
|
@ -105,7 +105,7 @@ else
|
|||
fi
|
||||
|
||||
if [ -n "$gitlab_domain" ]; then
|
||||
if egrep -q "${gitlab_domain}|${gitlab_ssh_domain}" <<<$giturl; then
|
||||
if egrep -q "${gitlab_domain}|${gitlab_ssh_domain}" <<<"$giturl"; then
|
||||
|
||||
# Handle GitLab's default SSH notation (like git@gitlab.domain.com:user/repo)
|
||||
giturl=${giturl/git\@${gitlab_ssh_domain}\:/${gitlab_protocol}://${gitlab_domain}/}
|
||||
|
|
@ -123,7 +123,7 @@ if [ -n "$gitlab_domain" ]; then
|
|||
providerUrlDifference=tree
|
||||
fi
|
||||
# hosted GitLab
|
||||
elif grep -q gitlab <<<$giturl; then
|
||||
elif grep -q gitlab <<<"$giturl"; then
|
||||
giturl=${giturl/git\@gitlab\.com\:/https://gitlab.com/}
|
||||
providerUrlDifference=tree
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"git-home": "git-open"
|
||||
},
|
||||
"scripts": {
|
||||
"lint:editorconfig": "eclint check git-open* readme*",
|
||||
"lint:editorconfig": "eclint check git-open* readme* .travis.yml",
|
||||
"lint:package": "pjv --recommendations --warnings",
|
||||
"lint:readme": "node ./node_modules/markdownlint/lib/markdownlint.js --config markdownlint.json README.md",
|
||||
"test": "npm run lint:package && npm run lint:readme && npm run lint:editorconfig"
|
||||
|
|
|
|||
Loading…
Reference in a new issue