Skip to content

Commit

Permalink
添加xcode打开命令行工具
Browse files Browse the repository at this point in the history
  • Loading branch information
zlfyuan committed Dec 16, 2020
1 parent 2418571 commit bcd3a40
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# iOSNote
<!--
* @Author: zluof
* @Date: 2020-12-16 16:33:38
* @LastEditTime: 2020-12-16 16:48:38
* @LastEditors: zluof
* @Description:
* @FilePath: /undefined/Users/zhongxiaoxi/Desktop/testc/iOSNote/README.md
-->
# iOSNote

# xcode_commadline 支持在终端打开iOS/Mac的项目
52 changes: 52 additions & 0 deletions xcode_commandline/bin/icode
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

###
# @Author: zluof
# @Date: 2020-08-17 11:28:45
# @LastEditTime: 2020-12-16 16:22:11
# @LastEditors: zluof
# @Description:
# @FilePath: /undefined/Users/zhongxiaoxi/Desktop/testc/testc.sh
###

root=$1

if [ ${#root} -eq 0 ]
then
echo `没有找到项目路径`
exit
else
root=$1
fi
space="true"
# echo $root
pod_xcodeproj="/Pods/Pods.xcodeproj"
for filename in `find "$root" -name "*.xcodeproj"`
do
# echo $filename
if [[ $filename =~ $pod_xcodeproj ]];
then
# 打开xcworkspace
# echo $filename
# echo `open *.xcworkspace`
space="true"
else
# 打开xcodeproj
# echo $filename
space="false"
file="$filename"
# echo `open *.xcodeproj`
fi
done
# echo $space
if [ $space == "true" ];
then
for xcworkspace in `find "$root" -name "*.xcworkspace"`
do
# echo $xcworkspace
file="$xcworkspace"
done
echo `open $file`
else
echo `open $file`
fi
52 changes: 52 additions & 0 deletions xcode_commandline/bin/icode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

###
# @Author: zluof
# @Date: 2020-08-17 11:28:45
# @LastEditTime: 2020-12-16 16:22:11
# @LastEditors: zluof
# @Description:
# @FilePath: /undefined/Users/zhongxiaoxi/Desktop/testc/testc.sh
###

root=$1

if [ ${#root} -eq 0 ]
then
echo `没有找到项目路径`
exit
else
root=$1
fi
space="true"
# echo $root
pod_xcodeproj="/Pods/Pods.xcodeproj"
for filename in `find "$root" -name "*.xcodeproj"`
do
# echo $filename
if [[ $filename =~ $pod_xcodeproj ]];
then
# 打开xcworkspace
# echo $filename
# echo `open *.xcworkspace`
space="true"
else
# 打开xcodeproj
# echo $filename
space="false"
file="$filename"
# echo `open *.xcodeproj`
fi
done
# echo $space
if [ $space == "true" ];
then
for xcworkspace in `find "$root" -name "*.xcworkspace"`
do
# echo $xcworkspace
file="$xcworkspace"
done
echo `open $file`
else
echo `open $file`
fi

0 comments on commit bcd3a40

Please sign in to comment.