This repository was archived by the owner on Dec 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxopen
More file actions
executable file
·34 lines (31 loc) · 1.26 KB
/
xopen
File metadata and controls
executable file
·34 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This script needs to be updated urgently
# Heres how the scripts should work
# 1) We do a recursive search for a project with the name of the current gitroot directory
# if we are in a git repo or the current parent directory if we are not
# 2) If this doesnt work and we are in a git repo then we add search for a project with all the directory
# names until the git repo
# 3) The script can take a parameter and then use the word in its matches
# 4) The script can also show the user the history of all projects it has opened before and the user can select
# one of them
#
#
# Estimated Time Requred - One day
#! /bin/bash
# Script that will run find an xcode project in any directory and run it in xcode
# The name of the xcode project should be same as the name of the parent directory
# The project can be in any branch of the directory tree
# If there are multiple projects with the name of the parent directory then the one
# which is found first by grep will be opened(I think it does BFS)
#
# Created By Sumeru Chatterjee
projectname=${PWD##*/}.xcodeproj
echo "Finding Xcode Project with name $projectname.."
file=$(find . -iname $projectname | tail -1)
if [ -z $file ];
then
echo "Project does not exist";
exit 0;
else
echo "Opening $file";
open -a Xcode $file
fi;