diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index ea6322008a..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,11 +0,0 @@ -# Setup archive tags - -.DS_Store export-ignore -.gitignore export-ignore -.gitattributes export-ignore -.gitmodules export-ignore -.travis.yml export-ignore -.editorconfig export-ignore -appveyor.yml export-ignore -Bootstrap.* export-ignore -packages/* export-ignore diff --git a/scripts/package.lua b/scripts/package.lua index 369cd5425f..b051bb11a7 100644 --- a/scripts/package.lua +++ b/scripts/package.lua @@ -217,7 +217,23 @@ if kind == "source" then print("Creating source code package...") - if not execQuiet("git add -f build") or + local excludeList = { + ".gitignore", + ".gitattributes", + ".gitmodules", + ".travis.yml", + ".editorconfig", + "appveyor.yml", + "Bootstrap.*", + "packages/*", + } + local includeList = { + "build", + "src/scripts.c", + } + + if not execQuiet("git rm --cached -r -f --ignore-unmatch "..table.concat(excludeList, ' ')) or + not execQuiet("git add -f "..table.concat(includeList, ' ')) or not execQuiet("git stash") or not execQuiet("git archive --format=zip -9 -o ../%s-src.zip --prefix=%s/ stash@{0}", pkgName, pkgName) or not execQuiet("git stash drop stash@{0}")