Compare commits
	
		
			2 Commits
		
	
	
		
			46e871b626
			...
			v5.2.3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ddc1d83d58 | |||
| 4b0a85411d | 
							
								
								
									
										13
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							@@ -18,6 +18,19 @@
 | 
			
		||||
				"*.yml",
 | 
			
		||||
			]
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"name": "Launch Package (Payday 2)",
 | 
			
		||||
			"type": "go",
 | 
			
		||||
			"request": "launch",
 | 
			
		||||
			"mode": "auto",
 | 
			
		||||
			"program": "${workspaceFolder}",
 | 
			
		||||
			"cwd": "C:/Users/Administrator/Seafile/Games-Payday2",
 | 
			
		||||
			"args": [
 | 
			
		||||
				"-loglevel",
 | 
			
		||||
				"trace",
 | 
			
		||||
				"*.yml",
 | 
			
		||||
			]
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"name": "Launch Package (Barotrauma cookfile)",
 | 
			
		||||
			"type": "go",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								main.go
									
									
									
									
									
								
							@@ -141,9 +141,6 @@ func main() {
 | 
			
		||||
		logger.Debug("Created logger for command %q with log level %s", cmdName, cmdLogLevel.String())
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// This aggregation is great but what if one modification replaces the whole entire file?
 | 
			
		||||
	// Shit......
 | 
			
		||||
	// TODO: Add "Isolate" field to modifications which makes them run alone
 | 
			
		||||
	for file, association := range associations {
 | 
			
		||||
		workers <- struct{}{}
 | 
			
		||||
		wg.Add(1)
 | 
			
		||||
 
 | 
			
		||||
@@ -86,6 +86,7 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s
 | 
			
		||||
	fileCommands := make(map[string]FileCommandAssociation)
 | 
			
		||||
 | 
			
		||||
	for _, file := range files {
 | 
			
		||||
		file = strings.ReplaceAll(file, "\\", "/")
 | 
			
		||||
		fileCommands[file] = FileCommandAssociation{
 | 
			
		||||
			File:            file,
 | 
			
		||||
			IsolateCommands: []ModifyCommand{},
 | 
			
		||||
@@ -94,9 +95,8 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s
 | 
			
		||||
		for _, command := range commands {
 | 
			
		||||
			for _, glob := range command.Files {
 | 
			
		||||
				static, pattern := SplitPattern(glob)
 | 
			
		||||
				file = strings.ReplaceAll(file, "\\", "/")
 | 
			
		||||
				file = strings.Replace(file, static+`/`, "", 1)
 | 
			
		||||
				matches, err := Matches(file, pattern)
 | 
			
		||||
				patternFile := strings.Replace(file, static+`/`, "", 1)
 | 
			
		||||
				matches, err := Matches(patternFile, pattern)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					logger.Trace("Failed to match glob %s with file %s: %v", glob, file, err)
 | 
			
		||||
					continue
 | 
			
		||||
@@ -190,7 +190,7 @@ func LoadCommands(args []string) ([]ModifyCommand, error) {
 | 
			
		||||
		logger.Info("Now total commands: %d", len(commands))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	logger.Info("Loaded %d commands from all cook f", len(commands))
 | 
			
		||||
	logger.Info("Loaded %d commands from all cook file", len(commands))
 | 
			
		||||
	return commands, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user