Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kicad-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
kicad-utils
Commits
cbc3e88f
Commit
cbc3e88f
authored
Sep 12, 2019
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Symlink script instead of copying them
parent
d99f1815
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
kicad-git-setup
+16
-20
16 additions, 20 deletions
kicad-git-setup
with
16 additions
and
20 deletions
kicad-git-setup
+
16
−
20
View file @
cbc3e88f
...
@@ -2,29 +2,24 @@
...
@@ -2,29 +2,24 @@
shopt
-s
nullglob
shopt
-s
nullglob
kicad-sch-filter
()
{
cat
$(
realpath
$(
dirname
$0
)
/kicad-sch-filter
)
}
kicad-pro-filter
()
{
cat
$(
realpath
$(
dirname
$0
)
/kicad-pro-filter
)
}
mkdir
-p
~/.config/git
mkdir
-p
~/.config/git
for
s
in
kicad-pro-filter kicad-sch-filter
;
do
for
s
in
kicad-pro-filter kicad-sch-filter
;
do
if
!
declare
-f
-F
$s
>
/dev/null
;
then
FILTER
=
$(
realpath
$(
dirname
$0
)
/kicad-sch-filter
)
echo
"
${
s
}
not defined"
if
[
-L
~/.config/git/
${
s
}
]
;
then
continue
if
[
$(
readlink
~/.config/git/
${
s
}
)
!=
${
FILTER
}
]
;
then
echo
REPLACE
link
rm
~/.config/git/
${
s
}
fi
elif
[
-f
~/.config/git/
${
s
}
]
;
then
if
diff
-q
<
(
$s
)
<
(
cat
~/.config/git/
${
s
}
)
;
then
echo
REPLACE file
rm
~/.config/git/
${
s
}
fi
fi
if
[
!
-f
~/.config/git/
${
s
}
]
;
then
echo
"Creating ~/.config/git/
${
s
}
"
cat
<
(
$s
)
>
~/.config/git/
${
s
}
chmod
+x ~/.config/git/
${
s
}
elif
!
diff <
(
$s
)
<
(
cat
~/.config/git/
${
s
}
)
>
/dev/null
;
then
echo
"Updating ~/.config/git/
${
s
}
"
cat
<
(
$s
)
>
~/.config/git/
${
s
}
chmod
+x ~/.config/git/
${
s
}
fi
fi
if
[
!
-L
~/.config/git/
${
s
}
]
;
then
ln
-s
$FILTER
~/.config/git/
${
s
}
fi
done
done
SCHEMATICS
=(
*
.sch
)
SCHEMATICS
=(
*
.sch
)
...
@@ -52,7 +47,7 @@ for s in ${PROJECT[@]} ; do
...
@@ -52,7 +47,7 @@ for s in ${PROJECT[@]} ; do
if
[[
"
$s
"
=
~
(
.
*
)
\.
pro
]]
;
then
if
[[
"
$s
"
=
~
(
.
*
)
\.
pro
]]
;
then
BASE
=
${
BASH_REMATCH
[1]
}
BASE
=
${
BASH_REMATCH
[1]
}
# Autoroute files
# Autoroute files
#
GITIGNORE+=( ${BASE}.bin ${BASE}.dsn ${BASE}.ses )
GITIGNORE+
=(
${
BASE
}
.bin
${
BASE
}
.dsn
${
BASE
}
.ses
)
# Other stuff
# Other stuff
GITIGNORE+
=(
${
BASE
}
-rescue
.lib
)
GITIGNORE+
=(
${
BASE
}
-rescue
.lib
)
fi
fi
...
@@ -78,6 +73,7 @@ for a in "${GITATTRIBUTES[@]}" ; do
...
@@ -78,6 +73,7 @@ for a in "${GITATTRIBUTES[@]}" ; do
echo
"
${
a
}
"
>>
.gitattributes
echo
"
${
a
}
"
>>
.gitattributes
fi
fi
done
done
FILTER
=(
"filter.kicad-pro.clean ~/.config/git/kicad-pro-filter clean %f"
)
FILTER
=(
"filter.kicad-pro.clean ~/.config/git/kicad-pro-filter clean %f"
)
FILTER+
=(
"filter.kicad-pro.smudge ~/.config/git/kicad-pro-filter smudge %f"
)
FILTER+
=(
"filter.kicad-pro.smudge ~/.config/git/kicad-pro-filter smudge %f"
)
FILTER+
=(
"filter.kicad-sch.clean ~/.config/git/kicad-sch-filter clean %f"
)
FILTER+
=(
"filter.kicad-sch.clean ~/.config/git/kicad-sch-filter clean %f"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment