Skip to content

Commit

Permalink
Added commands to rename before commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored and azure-sdk committed Nov 11, 2020
1 parent 1ee4271 commit 8041e49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eng/common/scripts/get-markdown-files-from-changed-files.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ $renamedFiles = (git diff $targetBranch HEAD --diff-filter=R)
$changedMarkdowns = (git diff $targetBranch HEAD --name-only -- '*.md')

$beforeRenameFiles = @()
# Retrieve the renamed from files.
# Retrieve the 'renamed from' files. Git command only returns back the files after rename.
# In order to have the files path before rename, it has to do some regex checking.
# It is better to be replaced by more reliable commands if any.
foreach ($file in $renamedFiles) {
if ($file -match "^rename from (.*)$") {
$beforeRenameFiles += $file -replace "^rename from (.*)$", '$1'
Expand Down

0 comments on commit 8041e49

Please sign in to comment.