Commit 2e69d0b5 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

rm unused xq

parent 8df81513
Loading
Loading
Loading
Loading

src/resources/add-bundle.xq

deleted100644 → 0
+0 −15
Original line number Diff line number Diff line
xquery version "3.0";

declare namespace configuration = "http://certic.unicaen.fr/max/ns/1.0";

declare variable $bundleUrl  external;

(:~
: Add bundle to configuration file
:)

let $bundles := doc('../../config.xml')//configuration:bundles

let $name := tokenize(file:name($bundleUrl),'\.')[1]

return insert node <bundle name="{$name}" url="{$bundleUrl}"/> into $bundles
+0 −24
Original line number Diff line number Diff line
xquery version "3.0";

declare namespace configuration = "http://certic.unicaen.fr/max/ns/1.0";


(:~
: Install bundles from configuration file
:)

let $bundles := doc('../../config.xml')//configuration:bundles/configuration:bundle


for $bundle in $bundles
    let $url := $bundle/@url/data()
    let $name := $bundle/@name/data()
    return if(ends-with($url, '.git'))
        then 
            let $path := file:current-dir() || '.max/basex/webapp/max/bundles/' || $name
            return if(not(file:exists($path)))
                then
                    let $result := proc:system('git', ('clone', $url, file:current-dir() || '.max/basex/webapp/max/bundles/' || $name))
                    return $result
            else ()        
        else()