Skip to content

Commit 5147cdb

Browse files
committed
FIX: Shellcheck fixes.
1 parent c758562 commit 5147cdb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/git-split-file.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ fullUsage() {
258258
# ------------------------------------------------------------------------------
259259
handleParams() {
260260

261-
local iDebugLevel sParam sRootFile sSplitDirectory sTargetDirectory
261+
local iDebugLevel sParam sRootFile sSplitDirectory
262262

263263
iDebugLevel=0
264264

@@ -363,14 +363,14 @@ createSourceBranch() {
363363
createBranchName() {
364364
local sFile
365365

366-
sFile="$(basename $1)"
366+
sFile=$(basename "${1}")
367367

368368
echo "${g_sSourceBranch}_${sFile}"
369369
}
370370

371371
createSplitBranch() {
372372
printStatus "Creating separate branch to split file '${1}'"
373-
createBranch "$(createBranchName ${1})" "${g_sSourceBranch}"
373+
createBranch "$(createBranchName "${1}")" "${g_sSourceBranch}"
374374
}
375375

376376
checkoutBranch() {
@@ -383,7 +383,7 @@ checkoutSplitBranch() {
383383

384384
sFile="${1}"
385385

386-
sBranchName="$(createBranchName ${sFile})"
386+
sBranchName=$(createBranchName "${sFile}")
387387

388388
checkoutBranch "${sBranchName}" 'split'
389389
}
@@ -401,7 +401,7 @@ mergeSplitBranch() {
401401
local -i iResult=0
402402
sFile="${1}"
403403

404-
sBranchName="$(createBranchName ${sFile})"
404+
sBranchName=$(createBranchName "${sFile}")
405405

406406
printTopic "Merging branch '${sBranchName}' back into '$(getCurrentBranch)'"
407407

@@ -485,7 +485,7 @@ splitFiles() {
485485
local sFile sFileName
486486

487487
for sFile in ${g_sSplitDirectory}/*;do
488-
sFileName="$(basename ${sFile})"
488+
sFileName=$(basename "${sFile}")
489489
#if [[ "${sFile}" = "${g_sSourceFileName}" ]];then
490490
# printStatus "Skipping source file '${g_sSourceFileName}'"
491491
#else
@@ -533,15 +533,15 @@ runCleanup() {
533533
git branch -D "${g_sSourceBranch}" | indent
534534

535535
for sFile in ${g_sSplitDirectory}/*;do
536-
sBranchName="$(createBranchName ${sFile})"
536+
sBranchName=$(createBranchName "${sFile}")
537537

538538
# shellcheck disable=SC2086
539539
if [[ -n "$(git show-ref refs/heads/${sBranchName})" ]];then
540540
# Branch exists
541541
git branch -D "${sBranchName}" | indent
542542
fi
543543
done
544-
sBranchName="$(createBranchName ${g_sSourceFileName})"
544+
sBranchName=$(createBranchName "${g_sSourceFileName}")
545545

546546
# shellcheck disable=SC2086
547547
if [[ -n "$(git show-ref refs/heads/${sBranchName})" ]];then

0 commit comments

Comments
 (0)