infinitered / ir-docs

Omnibus Documentation for Infinite Red Opensource
18 stars 5 forks source link

feat: Add symlink script to make symlinking projects in easier #35

Closed trevor-coleman closed 5 months ago

trevor-coleman commented 5 months ago

This adds a script that will create a symlink to your projects docs for easier testing:

To use the script, you'll need to run it with one of two commands: add or remove.

Add Symlink

The add command creates a new symbolic link. It requires two arguments: the project name and the directory path.

yarn symlink add [project_name] [path_to_directory]

This command creates a symbolic link at ./docs/[project_name] which points to [path_to_directory], and if a directory exists at that path, backs up the original contents of the directory to ./tmp/[project_name]

For example, if you want to create a symbolic link for a project called ignite-cli and the directory is located at ../ignite/docs, you'd run:

yarn symlink add ignite-cli ../ignite/docs

And you'll end up with ./docs/ignite-cli which points to ../ignite/docs

Remove Symlink

The remove command deletes an existing symbolic link. It requires only one argument: the project name.

yarn symlink remove [project_name]

This command removes the symbolic link found at ./docs/[project_name].

For example, to remove the symbolic link we created in the earlier example for ignite-cli, you'd run:

yarn symlink remove ignite-cli
trevor-coleman commented 5 months ago

Just adding one more feature -- going to get it to handle the /static folder correctly

trevor-coleman commented 5 months ago

OK it now also properly moves items from _static_ folders in projects the same way the CI script does.

trevor-coleman commented 5 months ago

And cleans up the tmp directory if its not needed any more