Commit d29f1591 authored by Addshore's avatar Addshore 🏄 Committed by Addshore
Browse files

README updates (new directories, dev.sh convenience script etc)

Various changes have been happening but the README is not totally up to date.
So update it!

And also add a ./dev.sh script which is now the recommended way to run the
tool in its un-built fashion.
This takes care of making sure that the static files are rebuild every time
you run the script, as this as tripped me over quite a few times during rapid
development.

Another alternative would be to force people to build each time, but IMO
we shouldn't force this as it just ends up being slower.

Change-Id: I6cbd916086c5177d5c0f98a03659e6d5d06ba467
parent 38e0b4a1
......@@ -55,6 +55,7 @@ unit:
test: unit lint
internal/mwdd/files/files.go: static/mwdd/*
rm internal/mwdd/files/files.go
staticfiles -o internal/mwdd/files/files.go static/mwdd/
.PHONY: install release
......@@ -5,9 +5,10 @@ development environments.
## Docker
In this initial version there is support for interacting with MediaWiki core's
docker-compose development environment, with subcommands provided under the
`docker` namespace: `mw help docker`.
There are currently 2 subcommands:
- `docker` allows interacting with MediaWiki core's docker-compose development environment. (See `mw help docker`)
- `mwdd` allows interacting with a new version of the MediaWiki-docker-dev development environment. (See `mw help mwdd`)
## Contributing
......@@ -19,15 +20,18 @@ Within the `~/go/src/gerrit.wikimedia.org/r/mediawiki/tools/cli/cmd` directory:
- run `go mod download` to download the required modules
- run `go mod vendor` to copy the required modules into a vendor directory for the project
Execute the script from any directory with `go run ~/go/src/gerrit.wikimedia.org/r/mediawiki/tools/cli/cmd/cli/main.go`
Execute the tool from any directory by running the `./dev.sh` script.
### Packages
### Packages & Directories
- `cmd`: Contains the Cobra commands and deals with all CLI user interaction
- `internal/docker`: Logic interacting with the mediawiki-docker dev environment
- `internal/env`: Logic interacting with a `.env` file
- `internal/exec`: Wrapper for the main `exec` package, providing easy verbosity etc
- `internal/mediawiki`: Logic interacting with a MediaWiki directory on disk
- `cmd`: Contains the Cobra commands and deals with all CLI user interaction.
- `internal/cmd`: General Cobra command abstractions that may be useful in multiple places.
- `internal/docker`: Logic interacting with the mediawiki-docker dev environment.
- `internal/env`: Logic interacting with a `.env` file.
- `internal/exec`: Wrapper for the main `exec` package, providing easy verbosity etc.
- `internal/mediawiki`: Logic interacting with a MediaWiki installation directory on disk.
- `internal/mwdd`: Logic for the MediaWiki-docker-dev development environment.
- `static`: Files that end up being built into the binary.
### cmd names
......
#!/bin/bash
SCRIPTPATH=$(dirname $(realpath $0))
WORKINGPATH=$(echo $PWD)
cd $SCRIPTPATH
# Force remake of the mwdd files
make internal/mwdd/files/files.go
# Run from source
go run ${SCRIPTPATH}/cmd/cli/main.go $@
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment