mirror of
https://github.com/subosito/flutter-action.git
synced 2024-08-16 10:19:50 +02:00
Merge pull request #90 from kuhnroyal/feature/pub-cache
Export PUB_CACHE if it is not in env
This commit is contained in:
commit
086f9fb649
2 changed files with 15 additions and 2 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
@ -123,9 +123,14 @@ function getFlutter(version, channel) {
|
||||||
toolPath = yield tc.cacheDir(sdkDir, 'flutter', cleanver);
|
toolPath = yield tc.cacheDir(sdkDir, 'flutter', cleanver);
|
||||||
}
|
}
|
||||||
core.exportVariable('FLUTTER_ROOT', toolPath);
|
core.exportVariable('FLUTTER_ROOT', toolPath);
|
||||||
|
let pubCachePath = process.env['PUB_CACHE'] || '';
|
||||||
|
if (!pubCachePath) {
|
||||||
|
pubCachePath = path.join(toolPath, '.pub-cache');
|
||||||
|
core.exportVariable('PUB_CACHE', pubCachePath);
|
||||||
|
}
|
||||||
core.addPath(path.join(toolPath, 'bin'));
|
core.addPath(path.join(toolPath, 'bin'));
|
||||||
core.addPath(path.join(toolPath, 'bin', 'cache', 'dart-sdk', 'bin'));
|
core.addPath(path.join(toolPath, 'bin', 'cache', 'dart-sdk', 'bin'));
|
||||||
core.addPath(path.join(toolPath, '.pub-cache', 'bin'));
|
core.addPath(path.join(pubCachePath, 'bin'));
|
||||||
if (useMaster) {
|
if (useMaster) {
|
||||||
yield exec.exec('flutter', ['channel', 'master']);
|
yield exec.exec('flutter', ['channel', 'master']);
|
||||||
yield exec.exec('flutter', ['upgrade']);
|
yield exec.exec('flutter', ['upgrade']);
|
||||||
|
|
|
@ -46,9 +46,17 @@ export async function getFlutter(
|
||||||
}
|
}
|
||||||
|
|
||||||
core.exportVariable('FLUTTER_ROOT', toolPath);
|
core.exportVariable('FLUTTER_ROOT', toolPath);
|
||||||
|
|
||||||
|
let pubCachePath = process.env['PUB_CACHE'] || '';
|
||||||
|
|
||||||
|
if (!pubCachePath) {
|
||||||
|
pubCachePath = path.join(toolPath, '.pub-cache');
|
||||||
|
core.exportVariable('PUB_CACHE', pubCachePath);
|
||||||
|
}
|
||||||
|
|
||||||
core.addPath(path.join(toolPath, 'bin'));
|
core.addPath(path.join(toolPath, 'bin'));
|
||||||
core.addPath(path.join(toolPath, 'bin', 'cache', 'dart-sdk', 'bin'));
|
core.addPath(path.join(toolPath, 'bin', 'cache', 'dart-sdk', 'bin'));
|
||||||
core.addPath(path.join(toolPath, '.pub-cache', 'bin'));
|
core.addPath(path.join(pubCachePath, 'bin'));
|
||||||
|
|
||||||
if (useMaster) {
|
if (useMaster) {
|
||||||
await exec.exec('flutter', ['channel', 'master']);
|
await exec.exec('flutter', ['channel', 'master']);
|
||||||
|
|
Loading…
Add table
Reference in a new issue