aws-lambda-layer-cli 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-lambda-layer-cli",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "CLI tool for creating and publishing AWS Lambda layers for Node.js and Python.",
5
5
  "keywords": [
6
6
  "aws",
@@ -25,6 +25,7 @@
25
25
  "homepage": "https://github.com/yukcw/aws-lambda-layer-cli#readme",
26
26
  "scripts": {
27
27
  "sync-version": "node scripts/sync_version.js",
28
+ "prepare": "npm run sync-version",
28
29
  "prepublishOnly": "npm run sync-version",
29
30
  "postinstall": "node scripts/install.js",
30
31
  "preuninstall": "node scripts/uninstall.js"
@@ -47,7 +47,7 @@ COMPLETION_DIR="/etc/bash_completion.d"
47
47
  # Show help
48
48
  show_help() {
49
49
  local version_file="$SCRIPT_DIR/VERSION.txt"
50
- local version="1.4.1"
50
+ local version="2.0.4"
51
51
  if [ -f "$version_file" ]; then
52
52
  version=$(cat "$version_file")
53
53
  fi
@@ -113,7 +113,7 @@ show_version() {
113
113
  echo "v$version"
114
114
  else
115
115
  # Fallback if VERSION file is missing (e.g. during development or if moved)
116
- echo "v1.4.1"
116
+ echo "v2.0.4"
117
117
  fi
118
118
  }
119
119
 
@@ -125,8 +125,26 @@ check_aws_cli() {
125
125
 
126
126
  if ! command -v aws &> /dev/null; then
127
127
  printf "${RED}Error: AWS CLI is not installed${NC}\n"
128
- printf "Please install AWS CLI first:\n"
129
- printf " https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html\n"
128
+ printf "Please install AWS CLI:\n\n"
129
+
130
+ # Detect OS and provide specific install command
131
+ if [[ "$OSTYPE" == "darwin"* ]]; then
132
+ printf " ${GREEN}macOS:${NC}\n"
133
+ printf " brew install awscli\n"
134
+ printf " ${ITALIC}or${NC}\n"
135
+ printf " curl \"https://awscli.amazonaws.com/AWSCLIV2.pkg\" -o \"AWSCLIV2.pkg\"\n"
136
+ printf " sudo installer -pkg AWSCLIV2.pkg -target /\n\n"
137
+ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
138
+ printf " ${GREEN}Linux:${NC}\n"
139
+ printf " curl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\n"
140
+ printf " unzip awscliv2.zip\n"
141
+ printf " sudo ./aws/install\n\n"
142
+ elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
143
+ printf " ${GREEN}Windows:${NC}\n"
144
+ printf " Download and run: https://awscli.amazonaws.com/AWSCLIV2.msi\n\n"
145
+ fi
146
+
147
+ printf " ${CYAN}More info:${NC} https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html\n"
130
148
  return 1
131
149
  fi
132
150
 
@@ -233,7 +251,7 @@ get_aws_account_info() {
233
251
  # Determine compatible runtimes for AWS
234
252
  get_compatible_runtimes() {
235
253
  local runtime="$1"
236
- local version="$2"
254
+ local version="2.0.4"
237
255
 
238
256
  case "$runtime" in
239
257
  nodejs)
@@ -256,7 +274,25 @@ check_dependencies() {
256
274
  # Check for zip
257
275
  if ! command -v zip &> /dev/null; then
258
276
  printf "${RED}Error: 'zip' command is not installed${NC}\n"
259
- printf "Please install zip first.\n"
277
+ printf "Please install zip:\n\n"
278
+
279
+ # Detect OS and provide specific install command
280
+ if [[ "$OSTYPE" == "darwin"* ]]; then
281
+ printf " ${GREEN}macOS:${NC}\n"
282
+ printf " brew install zip\n\n"
283
+ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
284
+ printf " ${GREEN}Ubuntu/Debian:${NC}\n"
285
+ printf " sudo apt-get update && sudo apt-get install -y zip\n\n"
286
+ printf " ${GREEN}RHEL/CentOS/Fedora:${NC}\n"
287
+ printf " sudo yum install -y zip\n\n"
288
+ printf " ${GREEN}Alpine:${NC}\n"
289
+ printf " apk add --no-cache zip\n\n"
290
+ elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
291
+ printf " ${GREEN}Windows:${NC}\n"
292
+ printf " Use PowerShell: Install-Package -Name zip\n"
293
+ printf " ${ITALIC}or install Git Bash which includes zip${NC}\n\n"
294
+ fi
295
+
260
296
  return 1
261
297
  fi
262
298
 
@@ -44,7 +44,7 @@ if ([string]::IsNullOrEmpty($InstallDir)) {
44
44
  # Configuration
45
45
  $RepoUrl = "https://github.com/yukcw/aws-lambda-layer-cli"
46
46
  $ToolName = "aws-lambda-layer-cli"
47
- $Version = "1.4.1" # Fallback version
47
+ $Version = "2.0.4" # Fallback version
48
48
 
49
49
  # Colors for output
50
50
  $Green = "Green"
@@ -7,16 +7,49 @@ const rootDir = path.resolve(__dirname, '..');
7
7
  const versionFile = path.join(rootDir, 'VERSION.txt');
8
8
  const packageJsonFile = path.join(rootDir, 'package.json');
9
9
 
10
+ // Files that need version updates
11
+ const scriptFiles = [
12
+ path.join(rootDir, 'scripts', 'aws-lambda-layer-cli'),
13
+ path.join(rootDir, 'aws_lambda_layer_cli', 'assets', 'aws-lambda-layer-cli'),
14
+ path.join(rootDir, 'scripts', 'install.ps1')
15
+ ];
16
+
10
17
  try {
11
18
  const version = fs.readFileSync(versionFile, 'utf8').trim();
12
- const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf8'));
19
+ let updated = false;
13
20
 
21
+ // Update package.json
22
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf8'));
14
23
  if (packageJson.version !== version) {
15
24
  console.log(`Updating package.json version from ${packageJson.version} to ${version}`);
16
25
  packageJson.version = version;
17
26
  fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2) + '\n');
18
- } else {
19
- console.log('package.json version is already up to date.');
27
+ updated = true;
28
+ }
29
+
30
+ // Update bash scripts
31
+ scriptFiles.forEach(file => {
32
+ if (fs.existsSync(file)) {
33
+ let content = fs.readFileSync(file, 'utf8');
34
+ let originalContent = content;
35
+
36
+ // Update version in bash scripts
37
+ content = content.replace(/local version="[^"]+"/g, `local version="${version}"`);
38
+ content = content.replace(/echo "v[0-9]+\.[0-9]+\.[0-9]+"/g, `echo "v${version}"`);
39
+
40
+ // Update version in PowerShell script
41
+ content = content.replace(/\$Version = "[^"]+"/g, `$Version = "${version}"`);
42
+
43
+ if (content !== originalContent) {
44
+ fs.writeFileSync(file, content);
45
+ console.log(`Updated version in ${path.relative(rootDir, file)}`);
46
+ updated = true;
47
+ }
48
+ }
49
+ });
50
+
51
+ if (!updated) {
52
+ console.log('All versions are already up to date.');
20
53
  }
21
54
  } catch (error) {
22
55
  console.error('Error syncing version:', error);
@@ -52,7 +52,7 @@ if command -v pip &> /dev/null || command -v pip3 &> /dev/null; then
52
52
  $PIP_CMD uninstall -y aws-lambda-layer-cli
53
53
  fi
54
54
  fi
55
-
55
+ aws-lambda-layer-cli --version
56
56
  # Check uv
57
57
  if command -v uv &> /dev/null; then
58
58
  if uv tool list | grep -q "aws-lambda-layer-cli"; then