CleanSlate icon indicating copy to clipboard operation
CleanSlate copied to clipboard

Support cloning into the mods folder

Open Zsar opened this issue 4 months ago • 4 comments

Currently the Clean Slate repository can only be cloned into an empty mods folder, not into one containing other git-provided mods. (Whose .git folder would conflict.)

Downloading the releases does not allow one to quickly change to a different tag or to "live on HEAD", both reasonable conducts for modders and for git users in general.

Anbennar for EU4 solves this issue amiably: The mod folder there is the root of the repository, the .mod file is placed into that folder. To install, one clones the repository into mods/ and then symlinks the .mod file into the mods folder.

This scales with an arbitrary number of mods and would be a desirable solution.

(Note that CK2Plus is another mod with git repository, so you immediately run into this issue yourself.)

Zsar avatar Sep 09 '25 14:09 Zsar

The current workaround is brittle:

  1. clone into mod/CleanSlate
  2. symlink the .mod file to mod/
  3. symlink everything inside mod/CleanSlate/CleanSlate into mod/CleanSlate/

This will, of course, silently break whenever a new item is added into mod/CleanSlate/CleanSlate.

It also makes git status unsightly, as it sees all the symlinks as files (because they are):

CleanSlate]$ git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	CleanSlate/tutorial/cleanslate.jpg
	CleanSlate/tutorial/common
	CleanSlate/tutorial/decisions
	CleanSlate/tutorial/dlc_metadata
	CleanSlate/tutorial/events
	CleanSlate/tutorial/gfx
	CleanSlate/tutorial/history
	CleanSlate/tutorial/interface
	CleanSlate/tutorial/localisation
	CleanSlate/tutorial/map
	CleanSlate/tutorial/master_changelog.txt
	CleanSlate/tutorial/music
	cleanslate.jpg
	common
	decisions
	dlc_metadata
	events
	gfx
	history
	interface
	localisation
	map
	master_changelog.txt
	music
	tutorial

Zsar avatar Sep 09 '25 14:09 Zsar

To clarify, is your proposed solution that we change the folder structure to add a mod folder between the .git files and the mod files?

schwarherz avatar Sep 09 '25 19:09 schwarherz

No, it is to have the CleanSlate folder inside the repository be the new root folder.

Such that one would do:

  1. mods] $ git clone https://github.com/ck2plus/CleanSlate.git - creates mods/CleanSlate
  2. mods] $ ln -s CleanSlate/CleanSlate.mod - creates mods/CleanSlate.mod, which will mirror any changes to mods/CleanSlate/CleanSlate.mod because it is a link, not an independent file

and be done.

(Since Windows 10, symlinking also works in Windows out-of-the-box, the command would there be mklink CleanSlate\CleanSlate.mod, or possibly mklink CleanSlate\CleanSlate.mod CleanSlate.mod - I do not recall if the target parameter is optional, like it is for ln.)

Zsar avatar Sep 09 '25 20:09 Zsar

Or to put it the other way around: I propose to move everything in the subfolder CleanSlate into the repository root.

Zsar avatar Sep 09 '25 20:09 Zsar