Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
7080a32e
Unverified
Commit
7080a32e
authored
3 years ago
by
Sergei Zharinov
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor(cocoapods): Use util function for cache dir creation (#10587)
parent
b53e5e40
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/manager/cocoapods/artifacts.ts
+5
-2
5 additions, 2 deletions
lib/manager/cocoapods/artifacts.ts
lib/manager/cocoapods/utils.ts
+0
-16
0 additions, 16 deletions
lib/manager/cocoapods/utils.ts
with
5 additions
and
18 deletions
lib/manager/cocoapods/artifacts.ts
+
5
−
2
View file @
7080a32e
...
@@ -4,13 +4,13 @@ import { TEMPORARY_ERROR } from '../../constants/error-messages';
...
@@ -4,13 +4,13 @@ import { TEMPORARY_ERROR } from '../../constants/error-messages';
import
{
logger
}
from
'
../../logger
'
;
import
{
logger
}
from
'
../../logger
'
;
import
{
ExecOptions
,
exec
}
from
'
../../util/exec
'
;
import
{
ExecOptions
,
exec
}
from
'
../../util/exec
'
;
import
{
import
{
ensureCacheDir
,
getSiblingFileName
,
getSiblingFileName
,
readLocalFile
,
readLocalFile
,
writeLocalFile
,
writeLocalFile
,
}
from
'
../../util/fs
'
;
}
from
'
../../util/fs
'
;
import
{
getRepoStatus
}
from
'
../../util/git
'
;
import
{
getRepoStatus
}
from
'
../../util/git
'
;
import
type
{
UpdateArtifact
,
UpdateArtifactsResult
}
from
'
../types
'
;
import
type
{
UpdateArtifact
,
UpdateArtifactsResult
}
from
'
../types
'
;
import
{
getCocoaPodsHome
}
from
'
./utils
'
;
const
pluginRegex
=
/^
\s
*plugin
\s
*
([
'"
])(?<
plugin>
[^
'"
]
+
)\1
/
;
const
pluginRegex
=
/^
\s
*plugin
\s
*
([
'"
])(?<
plugin>
[^
'"
]
+
)\1
/
;
...
@@ -67,11 +67,14 @@ export async function updateArtifacts({
...
@@ -67,11 +67,14 @@ export async function updateArtifacts({
);
);
const
tagConstraint
=
match
?.
groups
?.
cocoapodsVersion
??
null
;
const
tagConstraint
=
match
?.
groups
?.
cocoapodsVersion
??
null
;
const
cacheDir
=
await
ensureCacheDir
(
'
./others/cocoapods
'
,
'
CP_HOME_DIR
'
);
logger
.
debug
(
`Using cocoapods home
${
cacheDir
}
`
);
const
cmd
=
[...
getPluginCommands
(
newPackageFileContent
),
'
pod install
'
];
const
cmd
=
[...
getPluginCommands
(
newPackageFileContent
),
'
pod install
'
];
const
execOptions
:
ExecOptions
=
{
const
execOptions
:
ExecOptions
=
{
cwdFile
:
packageFileName
,
cwdFile
:
packageFileName
,
extraEnv
:
{
extraEnv
:
{
CP_HOME_DIR
:
await
getCocoaPodsHome
(
config
)
,
CP_HOME_DIR
:
cacheDir
,
},
},
docker
:
{
docker
:
{
image
:
'
cocoapods
'
,
image
:
'
cocoapods
'
,
...
...
This diff is collapsed.
Click to expand it.
lib/manager/cocoapods/utils.ts
deleted
100644 → 0
+
0
−
16
View file @
b53e5e40
import
{
join
}
from
'
upath
'
;
import
{
getAdminConfig
}
from
'
../../config/admin
'
;
import
{
logger
}
from
'
../../logger
'
;
import
{
ensureDir
}
from
'
../../util/fs
'
;
import
type
{
UpdateArtifactsConfig
}
from
'
../types
'
;
export
async
function
getCocoaPodsHome
(
config
:
UpdateArtifactsConfig
):
Promise
<
string
>
{
const
adminCacheDir
=
getAdminConfig
().
cacheDir
;
const
cacheDir
=
process
.
env
.
CP_HOME_DIR
||
join
(
adminCacheDir
,
'
./others/cocoapods
'
);
await
ensureDir
(
cacheDir
);
logger
.
debug
(
`Using cocoapods home
${
cacheDir
}
`
);
return
cacheDir
;
}
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