added skipping //comments in .patches

This commit is contained in:
partisan 2024-12-08 15:35:54 +01:00
parent e450251d84
commit bb64cea202

View file

@ -87,6 +87,11 @@ func applyPatch(patchPath, rootPath string) error {
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()
// Ignore lines starting with //
if strings.HasPrefix(strings.TrimSpace(line), "//") {
continue
}
// Detect the target file // Detect the target file
if strings.HasPrefix(line, "--- ") { if strings.HasPrefix(line, "--- ") {
relativePath := strings.TrimSpace(strings.TrimPrefix(line, "--- ")) relativePath := strings.TrimSpace(strings.TrimPrefix(line, "--- "))