mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Force drive letter to lower case when calculating project checksum on Windows // Resolve #4600
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from hashlib import sha1
|
||||
|
||||
@@ -94,7 +95,16 @@ def compute_project_checksum(config):
|
||||
checksum = sha1(hashlib_encode_data(__version__))
|
||||
|
||||
# configuration file state
|
||||
checksum.update(hashlib_encode_data(config.to_json()))
|
||||
config_data = config.to_json()
|
||||
if IS_WINDOWS:
|
||||
# issue #4600: fix drive letter
|
||||
config_data = re.sub(
|
||||
r"([A-Z]):\\",
|
||||
lambda match: "%s:\\" % match.group(1).lower(),
|
||||
config_data,
|
||||
flags=re.I,
|
||||
)
|
||||
checksum.update(hashlib_encode_data(config_data))
|
||||
|
||||
# project file structure
|
||||
check_suffixes = (".c", ".cc", ".cpp", ".h", ".hpp", ".s", ".S")
|
||||
|
Reference in New Issue
Block a user