" readname e...">
美文网首页
新建私有库脚本

新建私有库脚本

作者: chrisLL | 来源:发表于2019-03-10 16:47 被阅读0次

    #!/bin/sh

    echo "please enter your pod name ~>"

    readname

    echo "Build $name quickly."

    test -d ./Example/ || git clone "https://github.com/One1Light/Example.git"

    pod spec create $name 

    rm -rf $name.podspec.json

    pod ipc spec $name.podspec >> $name.podspec.json

    rm -rf $name.podspec

    sed -i '' 's/\("license": \).*/\1{"type":"MIT","file":"LICENSE"},/g'  $name.podspec.json

    rm -rf LICENSE

    touch LICENSE

    echo "Copyright (c) 2018-2030 $name ($USER@ziroom.com)

    Permission is hereby granted, free of charge, to any person obtaining a copy

    of this software and associated documentation files (the \"Software\"), to deal

    inthe Software without restriction, including without limitation the rights

    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

    copies of the Software, and to permit persons to whom the Software is

    furnished todoso, subject to the following conditions:

    The above copyright notice and this permission notice shall be includedin

    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

    THE SOFTWARE." > LICENSE

    echo 'LICENSE build sucess'

    test -d ./$name/ || mkdir -p ./$name/

    echo '$name build sucess'

    cd ./Example

    rm -rf podfile

    touch podfile

    sed -i '' '/\(# Pods for Example\)/a\   

    pod '\'$name\'', :path=>'\'../\''

    ' Podfile

    sed -i '' '/\(# platform :ios\)/a\   

    source '\'https://github.com/CocoaPods/Specs.git\''

    ' Podfile

    sed -i '' '/\(# platform :ios\)/a\   

    source '\'https://code.ziroom.com/wireless-architect-ios/ZRMoudleSpec.git\''

    ' Podfile

    cd ../

    open $name.podspec.json

    confirm=''

    echo 'confirm your spec.json is right? y/n'

    readconfirm 

    while[ $confirm !='y'] && [ $confirm !='n'] 

    do

        echo'confirm your spec.json is right? y/n'

        readconfirm

        echo $confirm

    done

    if[ $confirm =='n'] ;then

        exit0;

    fi

    cd ./Example

    pod install

    相关文章

      网友评论

          本文标题:新建私有库脚本

          本文链接:https://www.haomeiwen.com/subject/yqfppqtx.html