canvaslms-cli 1.1.0 → 1.1.1

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/lib/config.js CHANGED
@@ -5,10 +5,9 @@
5
5
  const fs = require('fs');
6
6
  const path = require('path');
7
7
  const os = require('os');
8
- require('dotenv').config();
9
8
 
10
9
  // Configuration file path in user's home directory
11
- const CONFIG_FILE = path.join(os.homedir(), '.canvas-cli-config.json');
10
+ const CONFIG_FILE = path.join(os.homedir(), '.canvaslms-cli-config.json');
12
11
 
13
12
  /**
14
13
  * Get default configuration structure
@@ -23,11 +22,11 @@ function getDefaultConfig() {
23
22
  }
24
23
 
25
24
  /**
26
- * Load configuration from file or environment variables
25
+ * Load configuration from file
27
26
  */
28
27
  function loadConfig() {
29
28
  try {
30
- // First, try to load from config file
29
+ // Load from config file
31
30
  if (fs.existsSync(CONFIG_FILE)) {
32
31
  const configData = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
33
32
  if (configData.domain && configData.token) {
@@ -37,24 +36,10 @@ function loadConfig() {
37
36
  }
38
37
  }
39
38
 
40
- // Fallback to environment variables
41
- let domain = process.env.CANVAS_DOMAIN;
42
- const token = process.env.CANVAS_API_TOKEN;
43
-
44
- if (!domain || !token) {
45
- console.error('❌ No Canvas configuration found!');
46
- console.error('\nPlease run "canvas config setup" to configure your Canvas credentials.');
47
- console.error('Or set environment variables:');
48
- console.error(' CANVAS_DOMAIN=your-canvas-domain.instructure.com');
49
- console.error(' CANVAS_API_TOKEN=your-api-token');
50
- process.exit(1);
51
- }
52
-
53
- // Clean up domain - remove https:// and trailing slashes
54
- domain = domain.replace(/^https?:\/\//, '').replace(/\/$/, '');
55
-
56
- return { domain, token };
57
- } catch (error) {
39
+ // No configuration found
40
+ console.error('❌ No Canvas configuration found!');
41
+ console.error('\nPlease run "canvas config setup" to configure your Canvas credentials.');
42
+ process.exit(1); } catch (error) {
58
43
  console.error(`❌ Error loading configuration: ${error.message}`);
59
44
  process.exit(1);
60
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvaslms-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A command line tool for interacting with Canvas LMS API",
5
5
  "keywords": [
6
6
  "canvas",
@@ -27,6 +27,7 @@
27
27
  "type": "commonjs",
28
28
  "main": "src/index.js",
29
29
  "bin": {
30
+ "canvaslms-cli": "src/index.js",
30
31
  "canvas": "src/index.js"
31
32
  },
32
33
  "files": [
package/src/index.js CHANGED
@@ -26,7 +26,7 @@ const program = new Command();
26
26
  program
27
27
  .name('canvas')
28
28
  .description('Canvas API Command Line Tool')
29
- .version('1.1.0');
29
+ .version('1.1.1');
30
30
 
31
31
  // Raw API commands
32
32
  function createQueryCommand(method) {