Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix premake copying directory tree on Unix #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

victorpopkov
Copy link

@victorpopkov victorpopkov commented Sep 7, 2021

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