v1.1.6 added homepageUrl argument
This commit is contained in:
@@ -15,6 +15,7 @@ export interface CLIArgsT {
|
||||
|
||||
url?: string
|
||||
supporturl?: string
|
||||
homepageurl?: string
|
||||
remotebranch?: string
|
||||
in?: string
|
||||
out?: string
|
||||
@@ -31,6 +32,7 @@ export const CLIArgs = commandLineArgs([
|
||||
|
||||
{ name: 'url', alias: 'u', type: String, defaultValue: '' },
|
||||
{ name: 'supporturl', alias: 's', type: String, defaultValue: '' },
|
||||
{ name: 'homepageurl', alias: 'U', type: String, defaultValue: '' },
|
||||
{ name: 'remotebranch', alias: 'b', type: String, defaultValue: '' },
|
||||
{ name: 'in', alias: 'i', type: String, defaultValue: 'scripts' },
|
||||
{ name: 'out', alias: 'o', type: String, defaultValue: 'dist' },
|
||||
@@ -41,6 +43,7 @@ export const CLIArgs = commandLineArgs([
|
||||
export const AllPaths = getAllPaths({
|
||||
baseUrl: CLIArgs.url || '',
|
||||
supportUrl: CLIArgs.supporturl || '',
|
||||
homepageUrl: CLIArgs.homepageurl || '',
|
||||
remoteBranch: CLIArgs.remotebranch || '',
|
||||
inBase: CLIArgs.in || 'scripts',
|
||||
outBase: CLIArgs.out || 'dist',
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface ScriptPathT {
|
||||
export interface getAllPathsOps {
|
||||
baseUrl: string
|
||||
supportUrl: string
|
||||
homepageUrl: string
|
||||
remoteBranch: string
|
||||
inBase: string
|
||||
outBase: string
|
||||
@@ -18,16 +19,20 @@ export interface getAllPathsOps {
|
||||
export default function getAllPaths({
|
||||
baseUrl,
|
||||
supportUrl,
|
||||
homepageUrl,
|
||||
remoteBranch,
|
||||
inBase,
|
||||
outBase,
|
||||
}: getAllPathsOps) {
|
||||
// generate links for remote git server
|
||||
const homeUrl = baseUrl
|
||||
if (baseUrl != '' && remoteBranch != '') {
|
||||
if (supportUrl == '') {
|
||||
supportUrl = `${baseUrl}/issues`
|
||||
}
|
||||
|
||||
if (homepageUrl == '') {
|
||||
homepageUrl = baseUrl
|
||||
}
|
||||
baseUrl = `${baseUrl}/raw/branch/${remoteBranch}/${outBase}`
|
||||
}
|
||||
|
||||
@@ -37,7 +42,7 @@ export default function getAllPaths({
|
||||
out: outBase,
|
||||
},
|
||||
url: {
|
||||
home: homeUrl,
|
||||
home: homepageUrl,
|
||||
base: baseUrl,
|
||||
support: supportUrl,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user