mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix merging of ".gitignore" files when re-initialize project // Resolve #848
This commit is contained in:
@ -56,6 +56,8 @@ PlatformIO 3.0
|
|||||||
(`issue #838 <https://github.com/platformio/platformio-core/issues/838>`_)
|
(`issue #838 <https://github.com/platformio/platformio-core/issues/838>`_)
|
||||||
* Fixed unable to include SSH user in ``lib_deps`` repository url
|
* Fixed unable to include SSH user in ``lib_deps`` repository url
|
||||||
(`issue #830 <https://github.com/platformio/platformio-core/issues/830>`_)
|
(`issue #830 <https://github.com/platformio/platformio-core/issues/830>`_)
|
||||||
|
* Fixed merging of ".gitignore" files when re-initialize project
|
||||||
|
(`issue #848 <https://github.com/platformio/platformio-core/issues/848>`_)
|
||||||
* Fixed issue with ``PATH`` auto-configuring for upload tools
|
* Fixed issue with ``PATH`` auto-configuring for upload tools
|
||||||
* Fixed ``99-platformio-udev.rules`` checker for Linux OS
|
* Fixed ``99-platformio-udev.rules`` checker for Linux OS
|
||||||
|
|
||||||
|
@ -127,13 +127,13 @@ class ProjectGenerator(object):
|
|||||||
|
|
||||||
# merge .gitignore
|
# merge .gitignore
|
||||||
if file_name == ".gitignore" and isfile(dst_path):
|
if file_name == ".gitignore" and isfile(dst_path):
|
||||||
contents = [l.strip() for l in contents.split("\n") if l.strip()]
|
default = [l.strip() for l in contents.split("\n")]
|
||||||
with open(dst_path) as f:
|
with open(dst_path) as fp:
|
||||||
for line in f.readlines():
|
current = [l.strip() for l in fp.readlines()]
|
||||||
line = line.strip()
|
for d in default:
|
||||||
if line and line not in contents:
|
if d and d not in current:
|
||||||
contents.append(line)
|
current.append(d)
|
||||||
contents = "\n".join(contents)
|
contents = "\n".join(current) + "\n"
|
||||||
|
|
||||||
with open(dst_path, "w") as f:
|
with open(dst_path, "w") as f:
|
||||||
f.write(contents)
|
f.write(contents)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
.pioenvs
|
.pioenvs
|
||||||
|
.piolibdeps
|
||||||
.clang_complete
|
.clang_complete
|
||||||
.gcc-flags.json
|
.gcc-flags.json
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
.pioenvs
|
.pioenvs
|
||||||
|
.piolibdeps
|
||||||
CMakeListsPrivate.txt
|
CMakeListsPrivate.txt
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
.pioenvs
|
.pioenvs
|
||||||
|
.piolibdeps
|
||||||
.clang_complete
|
.clang_complete
|
||||||
|
Reference in New Issue
Block a user