mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-20 17:40:59 +03:00
Merge branch 'dev'
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# db-load-git v1.0 — Load Git changes into 1C database
|
# db-load-git v1.1 — Load Git changes into 1C database
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Загрузка изменений из Git в базу 1С
|
Загрузка изменений из Git в базу 1С
|
||||||
@@ -172,26 +172,26 @@ try {
|
|||||||
switch ($Source) {
|
switch ($Source) {
|
||||||
"Staged" {
|
"Staged" {
|
||||||
Write-Host "Getting staged changes..."
|
Write-Host "Getting staged changes..."
|
||||||
$raw = git diff --cached --name-only 2>&1
|
$raw = git diff --cached --name-only --relative 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
}
|
}
|
||||||
"Unstaged" {
|
"Unstaged" {
|
||||||
Write-Host "Getting unstaged changes..."
|
Write-Host "Getting unstaged changes..."
|
||||||
$raw = git diff --name-only 2>&1
|
$raw = git diff --name-only --relative 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
$raw = git ls-files --others --exclude-standard 2>&1
|
$raw = git ls-files --others --exclude-standard 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
}
|
}
|
||||||
"Commit" {
|
"Commit" {
|
||||||
Write-Host "Getting changes from $CommitRange..."
|
Write-Host "Getting changes from $CommitRange..."
|
||||||
$raw = git diff --name-only $CommitRange 2>&1
|
$raw = git diff --name-only --relative $CommitRange 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
}
|
}
|
||||||
"All" {
|
"All" {
|
||||||
Write-Host "Getting all uncommitted changes..."
|
Write-Host "Getting all uncommitted changes..."
|
||||||
$raw = git diff --cached --name-only 2>&1
|
$raw = git diff --cached --name-only --relative 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
$raw = git diff --name-only 2>&1
|
$raw = git diff --name-only --relative 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
$raw = git ls-files --others --exclude-standard 2>&1
|
$raw = git ls-files --others --exclude-standard 2>&1
|
||||||
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
if ($LASTEXITCODE -eq 0) { $changedFiles += $raw }
|
||||||
@@ -201,7 +201,7 @@ try {
|
|||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
||||||
$changedFiles = $changedFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | Select-Object -Unique
|
$changedFiles = $changedFiles | Where-Object { $_ -is [string] -and -not [string]::IsNullOrWhiteSpace($_) } | Select-Object -Unique
|
||||||
|
|
||||||
if ($changedFiles.Count -eq 0) {
|
if ($changedFiles.Count -eq 0) {
|
||||||
Write-Host "No changes found"
|
Write-Host "No changes found"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# db-load-git v1.0 — Load Git changes into 1C database
|
# db-load-git v1.1 — Load Git changes into 1C database
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@@ -119,18 +119,18 @@ def main():
|
|||||||
|
|
||||||
if args.Source == "Staged":
|
if args.Source == "Staged":
|
||||||
print("Getting staged changes...")
|
print("Getting staged changes...")
|
||||||
changed_files += run_git(args.ConfigDir, ["diff", "--cached", "--name-only"])
|
changed_files += run_git(args.ConfigDir, ["diff", "--cached", "--name-only", "--relative"])
|
||||||
elif args.Source == "Unstaged":
|
elif args.Source == "Unstaged":
|
||||||
print("Getting unstaged changes...")
|
print("Getting unstaged changes...")
|
||||||
changed_files += run_git(args.ConfigDir, ["diff", "--name-only"])
|
changed_files += run_git(args.ConfigDir, ["diff", "--name-only", "--relative"])
|
||||||
changed_files += run_git(args.ConfigDir, ["ls-files", "--others", "--exclude-standard"])
|
changed_files += run_git(args.ConfigDir, ["ls-files", "--others", "--exclude-standard"])
|
||||||
elif args.Source == "Commit":
|
elif args.Source == "Commit":
|
||||||
print(f"Getting changes from {args.CommitRange}...")
|
print(f"Getting changes from {args.CommitRange}...")
|
||||||
changed_files += run_git(args.ConfigDir, ["diff", "--name-only", args.CommitRange])
|
changed_files += run_git(args.ConfigDir, ["diff", "--name-only", "--relative", args.CommitRange])
|
||||||
elif args.Source == "All":
|
elif args.Source == "All":
|
||||||
print("Getting all uncommitted changes...")
|
print("Getting all uncommitted changes...")
|
||||||
changed_files += run_git(args.ConfigDir, ["diff", "--cached", "--name-only"])
|
changed_files += run_git(args.ConfigDir, ["diff", "--cached", "--name-only", "--relative"])
|
||||||
changed_files += run_git(args.ConfigDir, ["diff", "--name-only"])
|
changed_files += run_git(args.ConfigDir, ["diff", "--name-only", "--relative"])
|
||||||
changed_files += run_git(args.ConfigDir, ["ls-files", "--others", "--exclude-standard"])
|
changed_files += run_git(args.ConfigDir, ["ls-files", "--others", "--exclude-standard"])
|
||||||
|
|
||||||
# Deduplicate and filter blanks
|
# Deduplicate and filter blanks
|
||||||
|
|||||||
Reference in New Issue
Block a user