JohnSundell / SwiftPlate

Easily generate cross platform Swift framework projects from the command line
MIT License
1.77k stars 88 forks source link

Adding check to prevent the source file from being overwritten by itself #42

Closed vijaytholpadi closed 7 years ago

vijaytholpadi commented 7 years ago

Fix for #39 Scenario: When the main.swift file is in the same folder as the target folder and we perform consecutive runs.

Effect: Looks like the main.swift was getting internally overwritten when the script was executed for the first time. Thereby corrupting the file for consecutive runs.

Fix: A check to prevent modifications to the source file which is executing the script.

JohnSundell commented 7 years ago

Thanks for this @vijaytholpadi! 😄