mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 10:37:13 +02:00
Cleanup package file name when packing
This commit is contained in:
@ -13,6 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -46,10 +47,14 @@ class PackagePacker(object):
|
|||||||
src = self.find_source_root(src)
|
src = self.find_source_root(src)
|
||||||
|
|
||||||
manifest = self.load_manifest(src)
|
manifest = self.load_manifest(src)
|
||||||
filename = "{name}{system}-{version}.tar.gz".format(
|
filename = re.sub(
|
||||||
|
r"[^\da-zA-Z\-\._]+",
|
||||||
|
"",
|
||||||
|
"{name}{system}-{version}.tar.gz".format(
|
||||||
name=manifest["name"],
|
name=manifest["name"],
|
||||||
system="-" + manifest["system"][0] if "system" in manifest else "",
|
system="-" + manifest["system"][0] if "system" in manifest else "",
|
||||||
version=manifest["version"],
|
version=manifest["version"],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
if not dst:
|
if not dst:
|
||||||
|
Reference in New Issue
Block a user