source: trunk/contrib/generate-plugin-manifest.sh @ 1421

Last change on this file since 1421 was 1421, checked in by gogo, 2 years ago

Add support for using external plugins with XinhaEasy.js and add Xinha.pluginManifest to describe location of built in plugins (and modules) without needing to "ping" them.

The pluginManifest can be generated by bash script contrib/generate-plugin-manifest.sh and should be done and updated before release.

For external/custom plugins when using XinhaEasy.js simply set the xinha_plugins option thusly...

xinha_plugins: [ 'BuiltInPlugin1', { from: '/path/to/custom/plugins', load: 'CustomPlugin1' } ]

It works even for the PHP plugins, MootoolsFileManager? and Linker when using Xinha from a CDN etc, as long of course as they have the contrib php-xinha.php available to them.

File size: 1.2 KB
Line 
1#!/usr/bin/bash
2if ! [ -f XinhaCore.js ]
3then
4  echo "$0: Execute this from the Xinha Root Directory" >&2
5  exit 1
6fi
7
8# To satisfy my sense of order I want them all lined up :-/
9NAME_LENGTH=22
10repl() { printf " "'%.s' $(eval "echo {1.."$(($1))"}"); }
11
12for dir in plugins modules unsupported_plugins
13do
14  cd $dir
15  for file in $(ls -d *)
16  do
17    TARGET="$file.js"
18   
19    # Some special cases
20    if [ "$file" = "CreateLink" ] && [ -f "$file/link.js" ]
21    then
22      TARGET="link.js"
23    elif [ "$file" = "Dialogs" ] && [ -f "$file/dialog.js" ]
24    then
25      TARGET="dialog.js"
26    elif [ "$file" = "GetHtml" ] && [ "$dir" = "modules" ]
27    then
28      continue
29    fi
30   
31    if ! [ -f "$file/$TARGET" ]
32    then
33      TARGET="$(echo $file | sed -r 's/([a-z])([A-Z])/\1_\2/' | tr '[:upper:]' '[:lower:]').js"
34    fi
35   
36    if ! [ -f "$file/$TARGET" ]
37    then
38      TARGET="$(echo $file | sed -r 's/([a-z])([A-Z])/\1-\2/' | tr '[:upper:]' '[:lower:]').js"
39    fi
40   
41    if ! [ -f "$file/$TARGET" ]
42    then       
43      echo "$0: Target For $dir/$file Not Found" >&2
44      exit 1
45    fi
46   
47    SPACES="$(repl $(expr $NAME_LENGTH - $(echo $file | wc -c)))"
48    echo "$file:$SPACES{ url: _editor_url+'$dir/$file/$TARGET' },"   
49  done
50  cd ../
51done
Note: See TracBrowser for help on using the repository browser.