Export PUB_CACHE if it is not in env
Export `PUB_CACHE` if it is not configured before calling the action. This ensures that flutter and dart use the same cache. It also enables other tools to use this official Dart env variable.
This commit is contained in:
@@ -46,9 +46,17 @@ export async function getFlutter(
|
||||
}
|
||||
|
||||
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', 'cache', 'dart-sdk', 'bin'));
|
||||
core.addPath(path.join(toolPath, '.pub-cache', 'bin'));
|
||||
core.addPath(path.join(pubCachePath, 'bin'));
|
||||
|
||||
if (useMaster) {
|
||||
await exec.exec('flutter', ['channel', 'master']);
|
||||
|
||||
Reference in New Issue
Block a user