Skip to content

Fix premake copying directory tree on Unix#16

Open
victorpopkov wants to merge 1 commit into
kleientertainment:masterfrom
dstmodders:issue/premake-copy-dir-tree
Open

Fix premake copying directory tree on Unix#16
victorpopkov wants to merge 1 commit into
kleientertainment:masterfrom
dstmodders:issue/premake-copy-dir-tree

Conversation

@victorpopkov

@victorpopkov victorpopkov commented Sep 7, 2021

Copy link
Copy Markdown

Just a quick fix. cp default behaviour differs from xcopy when it comes to copying directory trees, as it only requires the destination directory without the directory name itself.

Outputs

Directory tree (before)
build
├── dont_starve
│   └── mods
│       └── wand
│           ├── exported
│           │   └── wand
│           └── images
│               └── inventoryimages
├── linux
│   └── mod_tools
│       ├── buildtools
│       │   └── linux
│       │       └── Python27
│       │           └── Python27
│       │               └── Lib
│       │                   └── site-packages
│       │                       └── klei
│       └── mod_tools
│           ├── compiler_scripts
│           ├── data
│           ├── exported
│           ├── scripts
│           └── tools
│               └── scripts
└── proj
Directory tree (after)
build
├── dont_starve
│   └── mods
│       └── wand
│           ├── exported
│           │   └── wand
│           └── images
│               └── inventoryimages
├── linux
│   └── mod_tools
│       ├── buildtools
│       │   └── linux
│       │       └── Python27
│       │           └── Lib
│       │               └── site-packages
│       │                   └── klei
│       ├── compiler_scripts
│       ├── data
│       ├── exported
│       ├── scripts
│       └── tools
│           └── scripts
└── proj
Premake output (before)
Target OS not specified. Assuming it's the host OS.
which "unzip" &>/dev/null
mkdir -p "../build"
/usr/bin/unzip
mkdir -p "../build/dont_starve/mods"
unzip -q -o "../pkg/tst/wand.zip" -d "../build/dont_starve/mods"
mkdir -p "../build/linux/mod_tools"
cp -r "../pkg/cmn/mod_tools" "../build/linux/mod_tools"
mkdir -p "../build/linux/mod_tools/buildtools/linux/Python27"
cp -r "../pkg/unix/Python27" "../build/linux/mod_tools/buildtools/linux/Python27"
mkdir -p "../build/linux/mod_tools"
cp -r "../pkg/unix/mod_tools" "../build/linux/mod_tools"
Building configurations...
Running action 'gmake'...
Generating ../build/proj/Makefile...
Generating ../build/proj/scml.make...
Generating ../build/proj/png.make...
Generating ../build/proj/autocompiler.make...
Generating ../build/proj/modtoollib.make...
Done.
Premake output (after)
Target OS not specified. Assuming it's the host OS.
which "unzip" &>/dev/null
mkdir -p "../build"
/usr/bin/unzip
mkdir -p "../build/dont_starve/mods"
unzip -q -o "../pkg/tst/wand.zip" -d "../build/dont_starve/mods"
mkdir -p "../build/linux/mod_tools"
cp -r "../pkg/cmn/mod_tools" "../build/linux/mod_tools/.."
mkdir -p "../build/linux/mod_tools/buildtools/linux/Python27"
cp -r "../pkg/unix/Python27" "../build/linux/mod_tools/buildtools/linux/Python27/.."
mkdir -p "../build/linux/mod_tools"
cp -r "../pkg/unix/mod_tools" "../build/linux/mod_tools/.."
Building configurations...
Running action 'gmake'...
Generating ../build/proj/Makefile...
Generating ../build/proj/scml.make...
Generating ../build/proj/png.make...
Generating ../build/proj/autocompiler.make...
Generating ../build/proj/modtoollib.make...
Done.

Tested on

  • Linux (Ubuntu 20.04.3 LTS x86_64)
  • macOS (macOS 11.5.2 20G95 x86_64)
  • Windows (Windows 11 Pro 21H2 22000.176)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant