mirror of
				https://gitea.com/actions/cache.git
				synced 2025-11-02 07:47:08 +00:00 
			
		
		
		
	Disable zstd on Windows due to issue #301
This commit is contained in:
		
							
								
								
									
										5
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -3231,6 +3231,7 @@ const core = __importStar(__webpack_require__(470));
 | 
				
			|||||||
const exec = __importStar(__webpack_require__(986));
 | 
					const exec = __importStar(__webpack_require__(986));
 | 
				
			||||||
const glob = __importStar(__webpack_require__(281));
 | 
					const glob = __importStar(__webpack_require__(281));
 | 
				
			||||||
const io = __importStar(__webpack_require__(1));
 | 
					const io = __importStar(__webpack_require__(1));
 | 
				
			||||||
 | 
					const os = __importStar(__webpack_require__(87));
 | 
				
			||||||
const fs = __importStar(__webpack_require__(747));
 | 
					const fs = __importStar(__webpack_require__(747));
 | 
				
			||||||
const path = __importStar(__webpack_require__(622));
 | 
					const path = __importStar(__webpack_require__(622));
 | 
				
			||||||
const util = __importStar(__webpack_require__(669));
 | 
					const util = __importStar(__webpack_require__(669));
 | 
				
			||||||
@@ -3372,6 +3373,10 @@ function getVersion(app) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
function getCompressionMethod() {
 | 
					function getCompressionMethod() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
 | 
					        // Disabling zstd on Windows due to https://github.com/actions/cache/issues/301
 | 
				
			||||||
 | 
					        if (os.platform() === "win32") {
 | 
				
			||||||
 | 
					            return constants_1.CompressionMethod.Gzip;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        const versionOutput = yield getVersion("zstd");
 | 
					        const versionOutput = yield getVersion("zstd");
 | 
				
			||||||
        return versionOutput.toLowerCase().includes("zstd command line interface")
 | 
					        return versionOutput.toLowerCase().includes("zstd command line interface")
 | 
				
			||||||
            ? constants_1.CompressionMethod.Zstd
 | 
					            ? constants_1.CompressionMethod.Zstd
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@@ -3231,6 +3231,7 @@ const core = __importStar(__webpack_require__(470));
 | 
				
			|||||||
const exec = __importStar(__webpack_require__(986));
 | 
					const exec = __importStar(__webpack_require__(986));
 | 
				
			||||||
const glob = __importStar(__webpack_require__(281));
 | 
					const glob = __importStar(__webpack_require__(281));
 | 
				
			||||||
const io = __importStar(__webpack_require__(1));
 | 
					const io = __importStar(__webpack_require__(1));
 | 
				
			||||||
 | 
					const os = __importStar(__webpack_require__(87));
 | 
				
			||||||
const fs = __importStar(__webpack_require__(747));
 | 
					const fs = __importStar(__webpack_require__(747));
 | 
				
			||||||
const path = __importStar(__webpack_require__(622));
 | 
					const path = __importStar(__webpack_require__(622));
 | 
				
			||||||
const util = __importStar(__webpack_require__(669));
 | 
					const util = __importStar(__webpack_require__(669));
 | 
				
			||||||
@@ -3372,6 +3373,10 @@ function getVersion(app) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
function getCompressionMethod() {
 | 
					function getCompressionMethod() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
 | 
					        // Disabling zstd on Windows due to https://github.com/actions/cache/issues/301
 | 
				
			||||||
 | 
					        if (os.platform() === "win32") {
 | 
				
			||||||
 | 
					            return constants_1.CompressionMethod.Gzip;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        const versionOutput = yield getVersion("zstd");
 | 
					        const versionOutput = yield getVersion("zstd");
 | 
				
			||||||
        return versionOutput.toLowerCase().includes("zstd command line interface")
 | 
					        return versionOutput.toLowerCase().includes("zstd command line interface")
 | 
				
			||||||
            ? constants_1.CompressionMethod.Zstd
 | 
					            ? constants_1.CompressionMethod.Zstd
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ import * as exec from "@actions/exec";
 | 
				
			|||||||
import * as glob from "@actions/glob";
 | 
					import * as glob from "@actions/glob";
 | 
				
			||||||
import * as io from "@actions/io";
 | 
					import * as io from "@actions/io";
 | 
				
			||||||
import * as fs from "fs";
 | 
					import * as fs from "fs";
 | 
				
			||||||
 | 
					import * as os from "os";
 | 
				
			||||||
import * as path from "path";
 | 
					import * as path from "path";
 | 
				
			||||||
import * as util from "util";
 | 
					import * as util from "util";
 | 
				
			||||||
import * as uuidV4 from "uuid/v4";
 | 
					import * as uuidV4 from "uuid/v4";
 | 
				
			||||||
@@ -148,6 +149,11 @@ async function getVersion(app: string): Promise<string> {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function getCompressionMethod(): Promise<CompressionMethod> {
 | 
					export async function getCompressionMethod(): Promise<CompressionMethod> {
 | 
				
			||||||
 | 
					    // Disabling zstd on Windows due to https://github.com/actions/cache/issues/301
 | 
				
			||||||
 | 
					    if (os.platform() === "win32") {
 | 
				
			||||||
 | 
					        return CompressionMethod.Gzip;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const versionOutput = await getVersion("zstd");
 | 
					    const versionOutput = await getVersion("zstd");
 | 
				
			||||||
    return versionOutput.toLowerCase().includes("zstd command line interface")
 | 
					    return versionOutput.toLowerCase().includes("zstd command line interface")
 | 
				
			||||||
        ? CompressionMethod.Zstd
 | 
					        ? CompressionMethod.Zstd
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user