https://github.com/alias-mac/layout-upgrader
Sugar 7.0 Layout metadata upgrader
https://github.com/alias-mac/layout-upgrader
Last synced: over 1 year ago
JSON representation
Sugar 7.0 Layout metadata upgrader
- Host: GitHub
- URL: https://github.com/alias-mac/layout-upgrader
- Owner: alias-mac
- License: other
- Created: 2013-06-05T06:48:17.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-06-06T17:45:01.000Z (about 13 years ago)
- Last Synced: 2024-10-14T10:01:56.144Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 184 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Layout Upgrader
This is the Sugar 7.0 Layout upgrader.
## How to use the script
You can ask for help anytime by simply run:
```bash
$ ./update-layouts -h
```
You can run this with directories:
```bash
$ ./update-layouts -d="directory/to/convert"
$ ./update-layouts --dir="directory/to/convert"
```
Or files only:
```bash
$ ./update-layouts -f="file/to/convert"
$ ./update-layouts --file="file/to/convert"
```
Both can be have multiple values:
```bash
$ ./update-layouts -d="directory1/to/convert" -d="directory2/to/convert"
$ ./update-layouts -f="file1/to/convert" -f="file2/to/convert"
```
Directories can have regex patterns (that will be used by glob):
```bash
$ ./update-layouts -d="directory1/*/to/*/convert"
```
For your convenience, you can keep the script out of the sugarcrm path and
combine the params above with the path of the [SugarCRM][SugarCRM] instance to
update:
```bash
$ ./update-layouts -p="path/to/sugarcrm" -d="directory/to/convert"
$ ./update-layouts --path="path/to/sugarcrm" -d="directory/to/convert"
```
In order to avoid mistakes, you can see how the script will handle the params
by passing the `--dry-run` option.
```bash
$ ./update-layouts -p="path/to/sugarcrm" -d="directory/to/convert" --dry-run
```
To see more output information from the script, you can use the `-v` option
(for verbose).
```bash
$ ./update-layouts -p="path/to/sugarcrm" -d="directory/to/convert" --dry-run -v
```
You can pass the header file
```bash
$ ./update-layouts -p="path/to/sugarcrm" -d="directory/to/convert" --license=path/to/license/file
```
You can even be bold and run the script directly from github:
```bash
$ curl -sS https://raw.github.com/alias-mac/layout-upgrader/master/update-layouts | php -- --path="path/to/sugarcrm" -f="clients/base/layouts/activities/activities.php" --dry-run -v
```
### Removing .orig files in a burst
If you see that the script works great, you can delete the original files by
running a simple and fast command on your favorite shell:
```bash
$ find -name "*.php.orig" --delete
```
## Have fun!
## TODO
- Add the ability to run PSR-2 code fixer (optional param).
[SugarCRM]: http://www.sugarcrm.com/